client

package
v0.0.0-...-99cd9a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL