Skip to content

libconfig is a Go library that provides a simple method for populating a struct with data from environment variables

License

Notifications You must be signed in to change notification settings

jrudder/libconfig

Repository files navigation

libconfig

libconfig is a Go library that provides a simple method for populating a struct with data from environment variables.

GoDoc CircleCI Coverage

Goals

libconfig provides the following:

  • Parsing to built-in types
  • Parsing to slices and pointers
  • Support defaults, optionals, base64, and json
  • 100% code coverage

Non-Goals

libconfig does not and will not support these scenarios:

  • Config reloading: This is the work of deployment, canary releases, and blue/green environments.
  • Loading config from a file: Config should come from the environment only so that all environments (local, dev, prod, etc.) use the same code paths.

Prior Art

  • gonfig is a lightweight parser of JSON and env vars.
  • Stært can be used alone or with Flæg to provide config parsing from the command line, TOML, and key-value stores using libkv.
  • Viper is a feature-filled library with support for defaults, various formats (including JSON, TOML, and YAML), watching, and more.

About

libconfig is a Go library that provides a simple method for populating a struct with data from environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages