Documentation ¶
Overview ¶
Package remote created on 2017/6/22.
Index ¶
- Constants
- func NewConfigCenterSource(cc config.Client, refreshMode, refreshInterval int) source.ConfigSource
- type Source
- func (rs *Source) AddDimensionInfo(labels map[string]string) error
- func (rs *Source) Cleanup() error
- func (rs *Source) Delete(key string) error
- func (rs *Source) GetConfigurationByKey(key string) (interface{}, error)
- func (rs *Source) GetConfigurations() (map[string]interface{}, error)
- func (rs *Source) GetPriority() int
- func (*Source) GetSourceName() string
- func (rs *Source) Set(key string, value interface{}) error
- func (rs *Source) SetPriority(priority int)
- func (rs *Source) Watch(callback source.EventHandler) error
Constants ¶
View Source
const ( //Name variable of type string Name = "ConfigCenterSource" ModeInterval = 1 )
const
Variables ¶
This section is empty.
Functions ¶
func NewConfigCenterSource ¶
func NewConfigCenterSource(cc config.Client, refreshMode, refreshInterval int) source.ConfigSource
NewConfigCenterSource initializes all components of configuration center
Types ¶
type Source ¶
type Source struct { sync.RWMutex RefreshMode int RefreshInterval time.Duration // contains filtered or unexported fields }
Source handles configs from config center
func (*Source) AddDimensionInfo ¶
AddDimensionInfo adds dimension info for a configuration
func (*Source) GetConfigurationByKey ¶
GetConfigurationByKey gets required configuration for a particular key
func (*Source) GetConfigurations ¶
GetConfigurations pull config from remote and start refresh configs interval write a new map and return, internal map can not be operated outside struct
func (*Source) GetPriority ¶
GetPriority returns priority of a configuration
func (*Source) GetSourceName ¶
GetSourceName returns name of the configuration
func (*Source) SetPriority ¶
SetPriority custom priority
Click to show internal directories.
Click to hide internal directories.