Skip to content
Snippets Groups Projects
Commit 449df81a authored by Steffen Schulze's avatar Steffen Schulze
Browse files

Merge branch 'main' into 'main'

update readme

See merge request eclipse/xfsc/libraries/microservice/core!6
parents 5381f23f 3c222965
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,19 @@ type exampleConfig struct {
}
````
you can also define extra structs inside the config struct:
````go
type exampleConfig struct {
core.BaseConfig `mapstructure:",squash"`
TestValue string `mapstructure:"testValue"`
OAuth struct {
ServerUrl string `mapstructure:"serverUrl"`
ClientId string `mapstructure:"clientId"`
ClientSecret string `mapstructure:"clientSecret"`
} `mapstructure:"oAuth"`
}
````
2. Create global config struct instance and load config with LoadConfig() function. Provide Prefix for ENV variables and map with default values
````go
var ExampleConfig exampleConfig
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment