Documentation ¶
Index ¶
- Constants
- func GenerateLabels(dimension DimensionName, optionsLabels map[string]string) (map[string]string, error)
- func NewKieSource(ci *archaius.RemoteInfo) (source.ConfigSource, error)
- type Dimension
- type DimensionName
- type Kie
- type Source
- func (ks *Source) AddDimensionInfo(labels map[string]string) error
- func (ks *Source) Cleanup() error
- func (ks *Source) Delete(key string) error
- func (ks *Source) GetConfigurationByKey(key string) (interface{}, error)
- func (ks *Source) GetConfigurations() (map[string]interface{}, error)
- func (ks *Source) GetPriority() int
- func (*Source) GetSourceName() string
- func (ks *Source) Set(key string, value interface{}) error
- func (ks *Source) SetPriority(priority int)
- func (ks *Source) Watch(callback source.EventHandler) error
Constants ¶
const (
//Name is the source name of kie
Name = "KieSource"
)
const
Variables ¶
This section is empty.
Functions ¶
func GenerateLabels ¶
func GenerateLabels(dimension DimensionName, optionsLabels map[string]string) (map[string]string, error)
GenerateLabels generate labels to an specific dimensions
func NewKieSource ¶
func NewKieSource(ci *archaius.RemoteInfo) (source.ConfigSource, error)
NewKieSource initializes all components of ServiceComb-Kie
Types ¶
type Dimension ¶
Dimension contains a label combination and the configuration corresponding to this label combination
type DimensionName ¶
type DimensionName string
DimensionName is the name identifying various dimension of configurations. One dimension corresponds to one label combination.
const ( DimensionApp DimensionName = "app" DimensionService DimensionName = "service" )
const
type Kie ¶
type Kie struct {
// contains filtered or unexported fields
}
Kie is Implementation
func (*Kie) PullConfigs ¶
PullConfigs is the implementation of Kie to pull all the configurations from Config-Server
type Source ¶
type Source struct { sync.RWMutex RefreshMode int RefreshInterval time.Duration // contains filtered or unexported fields }
Source handles configs from ServiceComb-Kie
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