Skip to content

Confcerta is a library that loads configuration from multiple backends, inspired by confita

License

Notifications You must be signed in to change notification settings

wreulicke/confcerta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Confcerta

PkgGoDev

Confcerta is a library that load configuration from multiple backends, inspired by confita.

Usage

import (
    "github.com/wreulicke/confcerta"
)

type Config struct {
	A      string 
	// You can specify aliases using tag 
	B      string `config:"Foo"`
	C      string `config:"Bar"`
}

func main() {
    // json
    // {"A": "A value", "Foo": "B value", "Bar": "C value"}
    l := confcerta.New(file.New("testdata/simple.json"))
    c := Config{}
	l.Unmarshal(context.Background(), &c)
    // c.A == "A value"
    // c.B == "B value"
    // c.C == "C value"
}

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

About

Confcerta is a library that loads configuration from multiple backends, inspired by confita

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages