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(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 ¶
const ( //HeaderContentType is a variable of type string HeaderContentType = "Content-Type" //HeaderUserAgent is a variable of type string HeaderUserAgent = "User-Agent" )
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 ¶ added in v1.2.1
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(labels ...map[string]string) (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 ¶ added in v1.2.1
type Source struct { sync.RWMutex RefreshMode int RefreshInterval time.Duration // contains filtered or unexported fields }
Source handles configs from config center
func (*Source) AddDimensionInfo ¶ added in v1.2.1
AddDimensionInfo adds dimension info for a configuration
func (*Source) GetConfigurationByKey ¶ added in v1.2.1
GetConfigurationByKey gets required configuration for a particular key
func (*Source) GetConfigurations ¶ added in v1.2.1
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 ¶ added in v1.2.1
GetPriority returns priority of a configuration
func (*Source) GetSourceName ¶ added in v1.2.1
GetSourceName returns name of the configuration
func (*Source) SetPriority ¶ added in v1.2.1
SetPriority custom priority