Documentation ¶
Overview ¶
Package configcentersource created on 2017/6/22.
Index ¶
- Constants
- Variables
- func NewConfigCenterSource(memberDiscovery memberdiscovery.MemberDiscovery, dimInfo string, ...) core.ConfigSource
- type ConfigCenterEvent
- type ConfigCenterEventHandler
- type ConfigCenterSourceHandler
- func (cfgSrcHandler *ConfigCenterSourceHandler) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
- func (cfgSrcHandler *ConfigCenterSourceHandler) Cleanup() error
- func (cfgSrcHandler *ConfigCenterSourceHandler) DynamicConfigHandler(callback core.DynamicConfigCallback) error
- func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationByKey(key string) (interface{}, error)
- func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationByKeyAndDimensionInfo(key, dimensionInfo string) (interface{}, error)
- func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurations() (map[string]interface{}, error)
- func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationsByDI(dimensionInfo string) (map[string]interface{}, error)
- func (*ConfigCenterSourceHandler) GetPriority() int
- func (*ConfigCenterSourceHandler) GetSourceName() string
- func (cfgSrcHandler *ConfigCenterSourceHandler) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error)
- type CreateConfigAPI
- type DynamicConfigHandler
- type GetConfigAPI
Constants ¶
const (
//ConfigCenterSourceConst variable of type string
ConfigCenterSourceConst = "ConfigCenterSource"
)
Variables ¶
var ( //ConfigPath is a variable of type string ConfigPath = "" //ConfigRefreshPath is a variable of type string ConfigRefreshPath = "" )
Functions ¶
func NewConfigCenterSource ¶
func NewConfigCenterSource(memberDiscovery memberdiscovery.MemberDiscovery, dimInfo string, tlsConfig *tls.Config, tenantName string, refreshMode, refreshInterval int, enableSSL bool) core.ConfigSource
NewConfigCenterSource initializes all components of configuration center
Types ¶
type ConfigCenterEvent ¶
ConfigCenterEvent stores info about an configuration center event
type ConfigCenterEventHandler ¶
type ConfigCenterEventHandler struct {
// contains filtered or unexported fields
}
ConfigCenterEventHandler handles a event of a configuration center
func (*ConfigCenterEventHandler) OnConnect ¶
func (*ConfigCenterEventHandler) OnConnect()
OnConnect is a method
func (*ConfigCenterEventHandler) OnConnectionClose ¶
func (*ConfigCenterEventHandler) OnConnectionClose()
OnConnectionClose is a method
func (*ConfigCenterEventHandler) OnReceive ¶
func (eventHandler *ConfigCenterEventHandler) OnReceive(actionData []byte)
OnReceive initializes all necessary components for a configuration center
type ConfigCenterSourceHandler ¶
type ConfigCenterSourceHandler struct { MemberDiscovery memberdiscovery.MemberDiscovery Configurations map[string]interface{} sync.RWMutex TLSClientConfig *tls.Config TenantName string RefreshMode int RefreshInterval time.Duration // contains filtered or unexported fields }
ConfigCenterSourceHandler handles
func (*ConfigCenterSourceHandler) AddDimensionInfo ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) AddDimensionInfo(dimensionInfo string) (map[string]string, error)
AddDimensionInfo adds dimension info for a configuration
func (*ConfigCenterSourceHandler) Cleanup ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) Cleanup() error
Cleanup cleans the particular configuration up
func (*ConfigCenterSourceHandler) DynamicConfigHandler ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) DynamicConfigHandler(callback core.DynamicConfigCallback) error
DynamicConfigHandler dynamically handles a configuration
func (*ConfigCenterSourceHandler) GetConfigurationByKey ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationByKey(key string) (interface{}, error)
GetConfigurationByKey gets required configuration for a particular key
func (*ConfigCenterSourceHandler) GetConfigurationByKeyAndDimensionInfo ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationByKeyAndDimensionInfo(key, dimensionInfo string) (interface{}, error)
GetConfigurationByKeyAndDimensionInfo gets required configuration for a particular key and dimension pair
func (*ConfigCenterSourceHandler) GetConfigurations ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurations() (map[string]interface{}, error)
GetConfigurations gets a particular configuration
func (*ConfigCenterSourceHandler) GetConfigurationsByDI ¶
func (cfgSrcHandler *ConfigCenterSourceHandler) GetConfigurationsByDI(dimensionInfo string) (map[string]interface{}, error)
GetConfigurationsByDI gets required configurations for particular dimension info
func (*ConfigCenterSourceHandler) GetPriority ¶
func (*ConfigCenterSourceHandler) GetPriority() int
GetPriority returns priority of a configuration
func (*ConfigCenterSourceHandler) GetSourceName ¶
func (*ConfigCenterSourceHandler) GetSourceName() string
GetSourceName returns name of the configuration
type CreateConfigAPI ¶
type CreateConfigAPI struct { DimensionInfo string `json:"dimensionsInfo"` Items map[string]interface{} `json:"items"` }
CreateConfigAPI creates a configuration API
type DynamicConfigHandler ¶
type DynamicConfigHandler struct { EventHandler *ConfigCenterEventHandler // contains filtered or unexported fields }
DynamicConfigHandler is a struct
func (*DynamicConfigHandler) Cleanup ¶
func (dynHandler *DynamicConfigHandler) Cleanup() error
Cleanup cleans particular dynamic configuration ConfigCenterSourceHandler up