Documentation ¶
Index ¶
- Constants
- func GenerateDimension(serviceName, version, appName string) (string, error)
- func NewConfigCenterSource(ci *archaius.RemoteInfo) (source.ConfigSource, error)
- type ConfigCenter
- type Instance
- type Members
- type Source
- func (rs *Source) AddDimensionInfo(labels map[string]string) error
- func (rs *Source) Cleanup() error
- func (rs *Source) Delete(_ 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(_ string, _ interface{}) error
- func (rs *Source) SetPriority(priority int)
- func (rs *Source) Watch(callback source.EventHandler) error
Constants ¶
const (
//ConfigCenterSourceName variable of type string.
ConfigCenterSourceName = "ConfigCenterSource"
)
const.
Variables ¶
This section is empty.
Functions ¶
func GenerateDimension ¶
GenerateDimension create config center dimension string.
func NewConfigCenterSource ¶
func NewConfigCenterSource(ci *archaius.RemoteInfo) (source.ConfigSource, error)
NewConfigCenterSource initializes all components of configuration center.
Types ¶
type ConfigCenter ¶
type ConfigCenter struct {
// contains filtered or unexported fields
}
ConfigCenter is Implementation.
func NewConfigCenter ¶
func NewConfigCenter(options remote.Options) (*ConfigCenter, error)
NewConfigCenter is a function.
func (*ConfigCenter) Options ¶
func (c *ConfigCenter) Options() remote.Options
Options return options.
func (*ConfigCenter) PullConfigs ¶
func (c *ConfigCenter) PullConfigs() (map[string]interface{}, error)
PullConfigs is the implementation of ConfigCenter to pull all the configurations from Config-Server.
type Instance ¶
type Instance struct { Status string `json:"status"` ServiceName string `json:"serviceName"` IsHTTPS bool `json:"isHttps"` EntryPoints []string `json:"endpoints"` }
Instance is a struct.
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.