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