This is a new library aiming to simplify runtime configuration for Go applications. Expect more updates shortly.
CS - Config Source - Runtime library for flexible configuration.
go get -u github.com/activatedio/cs
The following example shows how to create a new config, add sources, and retrieve values
cfg := cs.New()
cfg.AddSource(cs.FromYAMLFile("cs.yaml"))
// Can be strings, maps or structs
cfg.AddSource(cs.FromValue("prefix.key", "value"))
cfg.AddLateBindingSource(cs.FromEnvironmentVars())
// Read reads value
var val *string
err := cs.Read("prefix.key", val)
// MustRead does the same but panics on error
//var val *string
//cs.MustRead("prefix.key", val)
fmt.Println(val)