Documentation ¶
Overview ¶
Package gxzookeeper provides a zookeeper registry
Package gxzookeeper provides a zookeeper watcher
Index ¶
- Constants
- func NewRegistry(opts ...gxregistry.Option) (gxregistry.Registry, error)
- func NewWatcher(r gxregistry.Registry, opts ...gxregistry.WatchOption) (gxregistry.Watcher, error)
- type Registry
- func (r *Registry) Client() *gxzookeeper.Client
- func (r *Registry) Close() error
- func (r *Registry) Deregister(s gxregistry.Service) error
- func (r *Registry) Done() <-chan struct{}
- func (r *Registry) GetServices(attr gxregistry.ServiceAttr) ([]gxregistry.Service, error)
- func (r *Registry) Options() gxregistry.Options
- func (r *Registry) Register(s gxregistry.Service) error
- func (r *Registry) String() string
- func (r *Registry) Watch(opts ...gxregistry.WatchOption) (gxregistry.Watcher, error)
- type Watcher
Constants ¶
View Source
const ( MAX_TIMES = 15 // 设置(wathcer)watchDir()等待时长 Wactch_Event_Channel_Size = 32 // 用于设置通知selector的event channel的size ZKCLIENT_EVENT_CHANNEL_SIZE = 4 // 设置用于zk client与watcher&consumer&provider之间沟通的channel的size )
Variables ¶
This section is empty.
Functions ¶
func NewRegistry ¶
func NewRegistry(opts ...gxregistry.Option) (gxregistry.Registry, error)
func NewWatcher ¶
func NewWatcher(r gxregistry.Registry, opts ...gxregistry.WatchOption) (gxregistry.Watcher, error)
Types ¶
type Registry ¶
type Registry struct { sync.Mutex // lock for client + register // contains filtered or unexported fields }
func (*Registry) Deregister ¶
func (*Registry) Done ¶
func (r *Registry) Done() <-chan struct{}
check whether the session has been closed.
func (*Registry) GetServices ¶
Click to show internal directories.
Click to hide internal directories.