api/pkg/config/defaults.go
Peter Kurfer 91f0cf6963 Improve config and startup handling
- use `Unmarshal` method of viper
- move config loading, defaulting and stuff to config package
- move serve to an extra command and move keep only global flags in root command
- add startup logic to onInit method in root command
- update mocks
- clean config structs
- adopt changes in plugins
- update default config
2020-06-15 12:32:18 +02:00

17 lines
339 B
Go

package config
var (
registeredDefaults = make(map[string]interface{})
// default aliases
registeredAliases = map[string]string{
"PluginsDirectory": "plugins-directory",
}
)
func AddDefaultValue(key string, val interface{}) {
registeredDefaults[key] = val
}
func AddAlias(alias, orig string) {
registeredAliases[alias] = orig
}