Documentation ¶
Index ¶
- Constants
- Variables
- 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
- func (k *Kie) MergeConfig() map[string]interface{}
- func (k *Kie) Options() remote.Options
- func (k *Kie) PullConfigs() (map[string]interface{}, error)
- func (k *Kie) SetDimensionConfigs(kvs *client.KVResponse, dimension DimensionName) bool
- func (k *Kie) Watch(f func(map[string]interface{}), errHandler func(err error)) error
- type Source
- func (ks *Source) AddDimensionInfo(labels map[string]string) error
- func (ks *Source) Cleanup() error
- func (ks *Source) Delete(_ 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(_ string, _ 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 ¶
var DimensionPrecedence = []DimensionName{ DimensionApp, DimensionService, }
Priority of dimension in DimensionPrecedence array must from low to high.
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) MergeConfig ¶ added in v0.0.8
func (*Kie) PullConfigs ¶
PullConfigs is the implementation of Kie to pull all the configurations from Config-Server.
func (*Kie) SetDimensionConfigs ¶ added in v0.0.8
func (k *Kie) SetDimensionConfigs(kvs *client.KVResponse, dimension DimensionName) bool
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.