Documentation ¶
Overview ¶
Package configmanager provides functions to communicate to Config-Center
Package configmanager provides deserializer
Index ¶
- Constants
- func NewConfigurationManager(dispatcher core.Dispatcher) core.ConfigMgr
- func ToRvalueType(confValue interface{}, convertType reflect.Type) (returnValue reflect.Value, err error)
- type ConfigurationManager
- func (configMgr *ConfigurationManager) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
- func (configMgr *ConfigurationManager) AddSource(source core.ConfigSource, priority int) error
- func (configMgr *ConfigurationManager) Cleanup()
- func (configMgr *ConfigurationManager) GetConfigurations() map[string]interface{}
- func (configMgr *ConfigurationManager) GetConfigurationsByDimensionInfo(dimensionInfo string) (map[string]interface{}, error)
- func (configMgr *ConfigurationManager) GetConfigurationsByKey(key string) interface{}
- func (configMgr *ConfigurationManager) GetConfigurationsByKeyAndDimensionInfo(dimensionInfo, key string) interface{}
- func (configMgr *ConfigurationManager) IsKeyExist(key string) bool
- func (configMgr *ConfigurationManager) OnEvent(event *core.Event)
- func (configMgr *ConfigurationManager) Refresh(sourceName string) error
- func (configMgr *ConfigurationManager) Unmarshal(obj interface{}) error
Constants ¶
const (
//DefaultPriority gives the default priority
DefaultPriority = -1
)
Variables ¶
This section is empty.
Functions ¶
func NewConfigurationManager ¶
func NewConfigurationManager(dispatcher core.Dispatcher) core.ConfigMgr
NewConfigurationManager creates an object of ConfigurationManager
Types ¶
type ConfigurationManager ¶
type ConfigurationManager struct { Sources map[string]core.ConfigSource ConfigurationMap map[string]string // contains filtered or unexported fields }
ConfigurationManager is a struct to stores information about different config-center and their configuration
func (*ConfigurationManager) AddDimensionInfo ¶
func (configMgr *ConfigurationManager) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
AddDimensionInfo adds the dimensionInfo to the list of which configurations needs to be pulled
func (*ConfigurationManager) AddSource ¶
func (configMgr *ConfigurationManager) AddSource(source core.ConfigSource, priority int) error
AddSource adds a source to configurationManager
func (*ConfigurationManager) Cleanup ¶
func (configMgr *ConfigurationManager) Cleanup()
Cleanup close and cleanup config manager channel
func (*ConfigurationManager) GetConfigurations ¶
func (configMgr *ConfigurationManager) GetConfigurations() map[string]interface{}
GetConfigurations returns all the configurationkeys
func (*ConfigurationManager) GetConfigurationsByDimensionInfo ¶
func (configMgr *ConfigurationManager) GetConfigurationsByDimensionInfo(dimensionInfo string) (map[string]interface{}, error)
GetConfigurationsByDimensionInfo returns list of all the configuration for a particular dimensionInfo
func (*ConfigurationManager) GetConfigurationsByKey ¶
func (configMgr *ConfigurationManager) GetConfigurationsByKey(key string) interface{}
GetConfigurationsByKey returns the value for a particluar key from cache
func (*ConfigurationManager) GetConfigurationsByKeyAndDimensionInfo ¶
func (configMgr *ConfigurationManager) GetConfigurationsByKeyAndDimensionInfo(dimensionInfo, key string) interface{}
GetConfigurationsByKeyAndDimensionInfo returns the key value for a particular dimensionInfo
func (*ConfigurationManager) IsKeyExist ¶
func (configMgr *ConfigurationManager) IsKeyExist(key string) bool
IsKeyExist check if key exsist in cache
func (*ConfigurationManager) OnEvent ¶
func (configMgr *ConfigurationManager) OnEvent(event *core.Event)
OnEvent Triggers actions when an event is generated
func (*ConfigurationManager) Refresh ¶
func (configMgr *ConfigurationManager) Refresh(sourceName string) error
Refresh refreshes the full configurations of all the dimnesionInfos
func (*ConfigurationManager) Unmarshal ¶
func (configMgr *ConfigurationManager) Unmarshal(obj interface{}) error
Unmarshal deserailize config into object