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 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.Logger) *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.