Confcerta
Confcerta is a library that load configuration from multiple backends, inspired by confita.
Usage
import (
"github.com/wreulicke/confcerta"
)
type Config struct {
A string
B string `config:"Foo"`
C string `config:"Bar"`
}
func main() {
l := confcerta.New(file.New("testdata/simple.json"))
c := Config{}
l.Unmarshal(context.Background(), &c)
}
Supported backends
- Environment variables
- Several format of files
- JSON files
- Yaml files
- Toml files
- HCL files
- Command line flags
- Amazon Systems Manager Parameter Store
- Amazon S3
- http.FileSystem
- io.Reader
Install
go get -u github.com/wreulicke/confcerta