f-25: code: add db api
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
87808312f4
commit
0506be8a87
5 changed files with 72 additions and 1 deletions
|
|
@ -31,6 +31,11 @@ type Config struct {
|
|||
Metadata struct {
|
||||
RunDir string `mapstructure:"run_dir"`
|
||||
} `mapstructure:"metadata"`
|
||||
Admin struct {
|
||||
Enabled bool `mapstructure:"enabled"`
|
||||
Address string `mapstructure:"address"`
|
||||
Port int `mapstructure:"port"`
|
||||
} `mapstructure:"admin"`
|
||||
DefaultInterface string `mapstructure:"default_interface"`
|
||||
Interfaces map[string]string `mapstructure:"interfaces"`
|
||||
}
|
||||
|
|
@ -50,6 +55,9 @@ func LoadConfig(path string) (*Config, error) {
|
|||
v.SetDefault("dispatcher.timeout_seconds", 300)
|
||||
v.SetDefault("dispatcher.poll_seconds", 2)
|
||||
v.SetDefault("metadata.run_dir", "/run/two/metadata")
|
||||
v.SetDefault("admin.enabled", false)
|
||||
v.SetDefault("admin.address", "127.0.0.1")
|
||||
v.SetDefault("admin.port", 9091)
|
||||
v.SetDefault("default_interface", "br-000000")
|
||||
v.SetDefault("logger.level", "info")
|
||||
v.SetDefault("logger.debug", false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue