Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
OldValue string
NewValue string
ChangeType ChangeType
}
Change ...
type ChangeEvent ¶
type ChangeEvent struct {
Source ChangeEventSource
Namespace string
Changes map[string]*Change
}
ChangeEvent ...
type ChangeEventSource ¶
type ChangeEventSource int
ChangeEventSource ...
const ( // Apollo change event source:apollo Apollo ChangeEventSource = iota )
type ChangeType ¶
type ChangeType int
ChangeType ...
const ( // ADD change type:add ADD ChangeType = iota // MODIFY change type:modify MODIFY // DELETE change type:delete DELETE )
type ConfigObserver ¶
type ConfigObserver struct {
// contains filtered or unexported fields
}
ConfigObserver listen config change event
func NewConfigObserver ¶
func NewConfigObserver(applyChangeEvent EventHandFunc) *ConfigObserver
NewConfigObserver ...
func (*ConfigObserver) HandleChangeEvent ¶
func (ob *ConfigObserver) HandleChangeEvent(event *ChangeEvent)
HandleChangeEvent send event to listen chan
func (*ConfigObserver) StartWatch ¶
func (ob *ConfigObserver) StartWatch(ctx context.Context)
StartWatch watch change event
type EventHandFunc ¶
type EventHandFunc func(context.Context, *ChangeEvent)
EventHandFunc handle event change
Click to show internal directories.
Click to hide internal directories.