configmanager

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package configmanager provides functions to communicate to Config-Center

Package configmanager provides deserializer

Index

Constants

View Source
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

func ToRvalueType

func ToRvalueType(confValue interface{}, convertType reflect.Type) (returnValue reflect.Value, err error)

ToRvalueType Deserializes the object to a particular type

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL