PackageManager just because
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
586 B

package Package
import (
yaml "gopkg.in/yaml.v2"
)
type Manifest struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Dependancies map[string]string `yaml:"dependancies,flow"`
}
func ParseManifestFile(manifest string) (Manifest, error) {
var (
m Manifest = Manifest{}
e error
)
e = yaml.Unmarshal([]byte(manifest), &m)
return m, e
}
func (m Manifest) CreateManifestString() (string, error) {
var (
mByte []byte
e error
)
mByte, e = yaml.Marshal(&m)
if e != nil {
return "", e
}
return string(mByte), e
}