Documentation ¶
Index ¶
- type Discovery
- func (d *Discovery) Initialize(uris string, heartbeat time.Duration, ttl time.Duration, ...) error
- func (d *Discovery) Register(key string, data []byte, stopCh <-chan struct{}) <-chan error
- func (d *Discovery) WatchExtend(key string, stopCh <-chan struct{}) (<-chan []byte, <-chan error)
- func (d *Discovery) WatchNodes(stopCh <-chan struct{}) (<-chan backends.Entries, <-chan error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
Discovery 发现服务结构定义 集成LibStore库实现
func (*Discovery) Initialize ¶
func (d *Discovery) Initialize(uris string, heartbeat time.Duration, ttl time.Duration, configopts map[string]string) error
Initialize 初始化一个Discovery实例 根据backend类型构造出libkv的Store
func (*Discovery) Register ¶
Register 服务注册 节点根据heartbeat轮询定时注册, 节点过期由ttl阈值决定 key: 集群节点唯一编码 data: 节点数据,可为nil stopCh: 退出心跳注册
func (*Discovery) WatchExtend ¶
WatchExtend 扩展路径监视 监视扩展路径变化 key: 一个被监视的全路径 stopCh: 退出服务发现
Click to show internal directories.
Click to hide internal directories.