Why Viper?
When building a modern application, you don’t want to worry aboutconfiguration file formats; you want to focus on building awesome software.Viper is here to help with that.
Viper does the following for you:
- Find, load, and unmarshal a configuration file in JSON, TOML, YAML, HCL, or Java properties formats.
- Provide a mechanism to set default values for your differentconfiguration options.
- Provide a mechanism to set override values for options specified throughcommand line flags.
- Provide an alias system to easily rename parameters without breaking existingcode.
Make it easy to tell the difference between when a user has provided acommand line or config file which is the same as the default.
Viper uses the following precedence order. Each item takes precedence over theitem below it:explicit call to Set
- flag
- env
- config
- key/value store
- default
Viper configuration keys are case insensitive.