Skip to content

gitsang/configer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configer

Configer is an automatic configurator based on Viper and Cobra, supporting automatic or manual binding of environment variables and command line arguments. Configure once, effective everywhere

Priority

Command-line arguments > Environment variables > Configuration files > Default values

Feature

Command-line arguments

Feature Supported
Auto binding
Binding by tag
Configurable prefix
Configurable tokenizers
Usage document

Environment variables

Feature Supported
Auto binding
Binding by tag
Configurable prefix
Configurable delim

Files

Feature Supported
Auto Binding
Binding by tag -
Configurable prefix ×
Configurable delim ×
Multiple Files
YAML
JSON

Default

Feature Supported
Load default from tag

Example

See ./example/main.go

Load from config file

go run . -c config.yaml

See command-line arguments help

go run . --help

Load from command-line arguments

go run . --example.log.level debug

Load from environment variables

EXAMPLE_LOG_LEVEL=trace go run .

About

Golang config manager, load config from config file, commandline arguments and environment variables. Configure once, effective everywhere

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages