alecthomas / kong-yaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kong YAML utilities CircleCI

Configuration loader

Use it like so:

parser, err := kong.New(&cli, kong.Configuration(kongyaml.Loader, "/etc/myapp/config.yaml", "~/.myapp.yaml"))

YAMLFileMapper

YAMLFileMapper implements kong.MapperValue to decode a YAML file into a struct field.

Use it like so:

var cli struct {
  Profile Profile `type:"yamlfile"`
}

func main() {
  kong.Parse(&cli, kong.NamedMapper("yamlfile", kongyaml.YAMLFileMapper))
}

About

License:MIT License


Languages

Language:Go 83.0%Language:Shell 17.0%