Documentation ¶
Index ¶
Constants ¶
View Source
const ( //ADD 新增节点 ADD = iota + 1 //CHANGE 节点变更 CHANGE //DEL 删除节点 DEL )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChildrenChangeArgs ¶
type ChildrenChangeArgs struct { Deep int Name string Parent string Children []string Version int32 OP int }
ChildrenChangeArgs 值变化通知事件
func NewCArgsByChange ¶
func NewCArgsByDelete ¶
func NewCArgsByDelete(deep int, parent string) *ChildrenChangeArgs
type ChildrenWatcher ¶
type ChildrenWatcher struct {
// contains filtered or unexported fields
}
ChildrenWatcher 监控器
func NewChildrenWatcher ¶
func NewChildrenWatcher(path string, deep int, timeSpan time.Duration, registry registry.IRegistry, logger logger.ILogger) *ChildrenWatcher
NewChildrenWatcher 初始化监控
func (*ChildrenWatcher) Changed ¶
func (w *ChildrenWatcher) Changed(children []string, version int32)
Changed 子节点发生变化
func (*ChildrenWatcher) Start ¶
func (w *ChildrenWatcher) Start() (c chan *ChildrenChangeArgs, err error)
Start 监控配置项变化,当发生错误时持续监控节点变化,只有明确节点不存在时才会通知关闭
type ConfWatcher ¶
type ConfWatcher struct {
// contains filtered or unexported fields
}
ConfWatcher 配置监控服务
func NewConfWatcher ¶
func NewConfWatcher(platName string, systemName string, serverTypes []string, clusterName string, rgst registry.IRegistry, logger *logger.Logger) (w *ConfWatcher, err error)
NewConfWatcher 初始化服务器监控程序
func (*ConfWatcher) Notify ¶
func (c *ConfWatcher) Notify() (chan *ContentChangeArgs, error)
Notify 服务器变更通知
type ContentChangeArgs ¶
ContentChangeArgs 值变化通知事件
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher 监控器
func NewWatcher ¶
func NewWatcher(path string, timeSpan time.Duration, registry registry.IRegistry, logger logger.ILogger) *Watcher
NewWatcher 初始化监控
func (*Watcher) Start ¶
func (w *Watcher) Start() (c chan *ContentChangeArgs, err error)
Start 监控配置项变化,当发生错误时持续监控节点变化,只有明确节点不存在时才会通知关闭
Click to show internal directories.
Click to hide internal directories.