Documentation
¶
Overview ¶
Package core provides a list of interface for Dispatcher and ConfigMgr
Index ¶
Constants ¶
View Source
const ( Update = "UPDATE" Delete = "DELETE" Create = "CREATE" InvalidAction = "INVALID-ACTION" )
Event Constant
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMgr ¶
type ConfigMgr interface {
AddSource(source ConfigSource, priority int) error
GetConfigurations() map[string]interface{}
GetConfigurationsByDimensionInfo(dimensionInfo string) (map[string]interface{}, error)
AddDimensionInfo(dimensionInfo string) (map[string]string, error)
GetConfigurationsByKey(key string) interface{}
GetConfigurationsByKeyAndDimensionInfo(dimensionInfo, key string) interface{}
IsKeyExist(string) bool
Unmarshal(interface{}) error
Refresh(sourceName string) error
Cleanup()
}
ConfigMgr manager Source
type ConfigSource ¶
type ConfigSource interface {
GetSourceName() string
GetConfigurations() (map[string]interface{}, error)
GetConfigurationsByDI(dimensionInfo string) (map[string]interface{}, error)
GetConfigurationByKey(string) (interface{}, error)
GetConfigurationByKeyAndDimensionInfo(key, dimensionInfo string) (interface{}, error)
AddDimensionInfo(dimensionInfo string) (map[string]string, error)
DynamicConfigHandler(DynamicConfigCallback) error
GetPriority() int
Cleanup() error
}
ConfigSource should implement this interface
type Dispatcher ¶
type Dispatcher interface {
// Function to send Events to all listener
DispatchEvent(event *Event) error
//Function to Register all listener for different key changes
RegisterListener(listenerObj EventListener, keys ...string) error
// remove listener
UnRegisterListener(listenerObj EventListener, keys ...string) error
}
Dispatcher is an interface for events Management
type DynamicConfigCallback ¶
type DynamicConfigCallback interface {
OnEvent(*Event)
}
DynamicConfigCallback is an interface for creating event on object change
type EventListener ¶
type EventListener interface {
Event(event *Event)
}
EventListener All EventListener should implement this Interface
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cast provides the typeCasting of an object
|
Package cast provides the typeCasting of an object |
|
Package configmanager provides functions to communicate to Config-Center Package configmanager provides deserializer
|
Package configmanager provides functions to communicate to Config-Center Package configmanager provides deserializer |
|
Package eventsystem provides the different Listeners
|
Package eventsystem provides the different Listeners |
Click to show internal directories.
Click to hide internal directories.