Documentation ¶
Index ¶
- func GetCurrentConfigDirectories() (main, legacy, overwrite string)
- func GetServiceConfigs(serviceName string) (map[string]*ConfigMap, error)
- func GetStructuredServiceConfig(moduleName string, serviceName string, out interface{}) (string, string, error)
- func GetStructuredServiceConfigExt(moduleName, serviceName, configDir, oldConfigDir, configOverrideDir string, ...) (ymlFilePath, ymlQWFilePath string, err error)
- func SetConfigDirectories(main, legacy, overwrite string)
- type ConfigMap
- func (c *ConfigMap) GetBool(key string) (bool, error)
- func (c *ConfigMap) GetInt(key string) (int, error)
- func (c *ConfigMap) GetMap(key string) (map[interface{}]interface{}, error)
- func (c *ConfigMap) GetString(key string) (string, error)
- func (c *ConfigMap) GetStrings(key string) ([]string, error)
- func (c *ConfigMap) MustGetBool(key string) bool
- func (c *ConfigMap) MustGetInt(key string) int
- func (c *ConfigMap) MustGetMap(key string) map[interface{}]interface{}
- func (c *ConfigMap) MustGetString(key string) string
- func (c *ConfigMap) MustGetStrings(key string) []string
- func (c *ConfigMap) SetString(strPtr *string, key string) error
- func (c *ConfigMap) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentConfigDirectories ¶
func GetCurrentConfigDirectories() (main, legacy, overwrite string)
GetCurrentConfigDirectories returns currently used service YML configuration locations
func GetServiceConfigs ¶
GetServiceConfigs returns module-keyed configs for the named service from all known modules. The list of known modules is determined by listing all non-directory files under /etc/magma/configs.
func GetStructuredServiceConfig ¶
func GetStructuredServiceConfig(moduleName string, serviceName string, out interface{}) (string, string, error)
GetStructuredServiceConfig updates 'out' structure with configs from the configs YML If successful, GetStructuredServiceConfig returns used YML file path & used overwrite cfg YML file path
func GetStructuredServiceConfigExt ¶
func GetStructuredServiceConfigExt( moduleName, serviceName, configDir, oldConfigDir, configOverrideDir string, out interface{}) (ymlFilePath, ymlQWFilePath string, err error)
GetStructuredServiceConfigExt is an extended version of GetStructuredServiceConfig, it allows to pass config directory names
func SetConfigDirectories ¶
func SetConfigDirectories(main, legacy, overwrite string)
SetConfigDirectories sets main, legacy, overwrite config directories to be used
Types ¶
type ConfigMap ¶
type ConfigMap struct {
RawMap map[interface{}]interface{}
}
ConfigMap represents a map generated from a service YML file.
func GetServiceConfig ¶
GetServiceConfig loads a config by name to a map of parameters Input: configName - name of config to load, e.g. control_proxy Output: map of parameters if it exists, error if not
func MustGetServiceConfig ¶
MustGetServiceConfig is same as GetServiceConfig but fails on errors.
func NewConfigMap ¶
func NewConfigMap(config map[interface{}]interface{}) *ConfigMap
NewConfigMap creates a new ConfigMap based on the input map.
func (*ConfigMap) GetMap ¶
GetMap retrieves the map[interface{}]interface{} parameter keyed by the passed key.
func (*ConfigMap) GetStrings ¶
GetStrings retrieves the []string parameter keyed by the passed key.
func (*ConfigMap) MustGetBool ¶
MustGetBool is same as GetBool but fails on errors and when the value does not exist.
func (*ConfigMap) MustGetInt ¶
MustGetInt is same as GetInt but fails on errors and when the value does not exist.
func (*ConfigMap) MustGetMap ¶
MustGetMap is same as GetMap but fails on errors and when the value does not exist.
func (*ConfigMap) MustGetString ¶
MustGetString is same as GetString but fails on errors and when the value does not exist.
func (*ConfigMap) MustGetStrings ¶
MustGetStrings is same as GetStrings but fails on errors and when the value does not exist.