Configuration reader. Configuration reader can read configuration from three sources. 1) Default value, 2) Environment variable 3) From json configuration file Configuration reader allows to have dynaic tags. I.e. tags which value depends on environment variable or dictionary value
For example for structure:
type TestStruct struct {
Mode string `env:`${SERVER_NAME}_MODE`
Port int `env:`${SERVER_NAME}_PORT`
}
If environment variable 'SERVER_NAME' has value 'TEST' field 'Mode' will be processed in the follow way:
- Environment variable name will be calculated as TEST_MODE.
- Value of field 'Mode' will get from environment variable 'TEST_MODE' if defined