package app import ( "forge.cadoles.com/arcad/edge/pkg/bundle" "github.com/pkg/errors" "gopkg.in/yaml.v2" ) type ID string type Manifest struct { ID ID `yaml:"id"` Version string `yaml:"version"` Title string `yaml:"title"` Description string `yaml:"description"` Tags []string `yaml:"tags"` } func LoadManifest(b bundle.Bundle) (*Manifest, error) { reader, _, err := b.File("manifest.yml") if err != nil { return nil, errors.Wrap(err, "could not read manifest.yml") } defer func() { if err := reader.Close(); err != nil { panic(errors.WithStack(err)) } }() manifest := &Manifest{} decoder := yaml.NewDecoder(reader) if err := decoder.Decode(manifest); err != nil { return nil, errors.Wrap(err, "could not decode manifest.yml") } return manifest, nil }