Documentation ¶
Index ¶
- type ZookeeperDiscovery
- func NewZookeeperDiscovery(basePath string, servicePath string, zkAddr []string, options *store.Config) (*ZookeeperDiscovery, error)
- func NewZookeeperDiscoveryTemplate(basePath string, zkAddr []string, options *store.Config) (*ZookeeperDiscovery, error)
- func NewZookeeperDiscoveryWithStore(basePath string, kv store.Store) (*ZookeeperDiscovery, error)
- func (d *ZookeeperDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
- func (d *ZookeeperDiscovery) Close()
- func (d *ZookeeperDiscovery) GetServices() []*client.KVPair
- func (d *ZookeeperDiscovery) RemoveWatcher(ch chan []*client.KVPair)
- func (d *ZookeeperDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
- func (d *ZookeeperDiscovery) WatchService() chan []*client.KVPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ZookeeperDiscovery ¶
type ZookeeperDiscovery struct { // -1 means it always retry to watch until zookeeper is ok, 0 means no retry. RetriesAfterWatchFailed int // contains filtered or unexported fields }
ZookeeperDiscovery is a zoopkeer service discovery. It always returns the registered servers in zookeeper.
func NewZookeeperDiscovery ¶
func NewZookeeperDiscovery(basePath string, servicePath string, zkAddr []string, options *store.Config) (*ZookeeperDiscovery, error)
NewZookeeperDiscovery returns a new ZookeeperDiscovery.
func NewZookeeperDiscoveryTemplate ¶
func NewZookeeperDiscoveryTemplate(basePath string, zkAddr []string, options *store.Config) (*ZookeeperDiscovery, error)
NewZookeeperDiscoveryTemplate returns a new ZookeeperDiscovery template.
func NewZookeeperDiscoveryWithStore ¶
func NewZookeeperDiscoveryWithStore(basePath string, kv store.Store) (*ZookeeperDiscovery, error)
NewZookeeperDiscoveryWithStore returns a new ZookeeperDiscovery with specified store.
func (*ZookeeperDiscovery) Clone ¶
func (d *ZookeeperDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
Clone clones this ServiceDiscovery with new servicePath.
func (*ZookeeperDiscovery) Close ¶
func (d *ZookeeperDiscovery) Close()
func (*ZookeeperDiscovery) GetServices ¶
func (d *ZookeeperDiscovery) GetServices() []*client.KVPair
GetServices returns the servers
func (*ZookeeperDiscovery) RemoveWatcher ¶
func (d *ZookeeperDiscovery) RemoveWatcher(ch chan []*client.KVPair)
func (*ZookeeperDiscovery) SetFilter ¶
func (d *ZookeeperDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
SetFilter sets the filer.
func (*ZookeeperDiscovery) WatchService ¶
func (d *ZookeeperDiscovery) WatchService() chan []*client.KVPair
WatchService returns a nil chan.
Click to show internal directories.
Click to hide internal directories.