Initial version

This commit is contained in:
2021-11-30 12:04:28 +01:00
commit f095f39eaf
9 changed files with 567 additions and 0 deletions

33
compose/parser.go Normal file
View File

@@ -0,0 +1,33 @@
package compose
import (
"log"
"os"
"gopkg.in/yaml.v3"
)
type Parser struct {
Data *Compose
}
var Appname = ""
func NewParser(filename string) *Parser {
f, err := os.Open(filename)
if err != nil {
log.Fatal(err)
}
c := NewCompose()
dec := yaml.NewDecoder(f)
dec.Decode(c)
p := &Parser{Data: c}
return p
}
func (p *Parser) Parse(appname string) {
Appname = appname
}