Documentation ¶
Index ¶
- func NewEtcdDiscovery(basePath string, servicePath string, etcdAddr []string, allowKeyNotFound bool, ...) (client.ServiceDiscovery, error)
- func NewEtcdDiscoveryStore(basePath string, kv store.Store, allowKeyNotFound bool) (client.ServiceDiscovery, error)
- func NewEtcdDiscoveryTemplate(basePath string, etcdAddr []string, allowKeyNotFound bool, ...) (client.ServiceDiscovery, error)
- func NewEtcdV3Discovery(basePath string, servicePath string, etcdAddr []string, allowKeyNotFound bool, ...) (client.ServiceDiscovery, error)
- func NewEtcdV3DiscoveryStore(basePath string, kv store.Store, allowKeyNotFound bool) (client.ServiceDiscovery, error)
- func NewEtcdV3DiscoveryTemplate(basePath string, etcdAddr []string, allowKeyNotFound bool, ...) (client.ServiceDiscovery, error)
- type EtcdDiscovery
- func (d *EtcdDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
- func (d *EtcdDiscovery) Close()
- func (d *EtcdDiscovery) GetServices() []*client.KVPair
- func (d *EtcdDiscovery) RemoveWatcher(ch chan []*client.KVPair)
- func (d *EtcdDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
- func (d *EtcdDiscovery) WatchService() chan []*client.KVPair
- type EtcdV3Discovery
- func (d *EtcdV3Discovery) Clone(servicePath string) (client.ServiceDiscovery, error)
- func (d *EtcdV3Discovery) Close()
- func (d *EtcdV3Discovery) GetServices() []*client.KVPair
- func (d *EtcdV3Discovery) RemoveWatcher(ch chan []*client.KVPair)
- func (d *EtcdV3Discovery) SetFilter(filter client.ServiceDiscoveryFilter)
- func (d *EtcdV3Discovery) WatchService() chan []*client.KVPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEtcdDiscovery ¶
func NewEtcdDiscovery(basePath string, servicePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)
NewEtcdDiscovery returns a new EtcdDiscovery.
func NewEtcdDiscoveryStore ¶
func NewEtcdDiscoveryStore(basePath string, kv store.Store, allowKeyNotFound bool) (client.ServiceDiscovery, error)
NewEtcdDiscoveryStore return a new EtcdDiscovery with specified store.
func NewEtcdDiscoveryTemplate ¶
func NewEtcdDiscoveryTemplate(basePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)
NewEtcdDiscoveryTemplate returns a new EtcdDiscovery template.
func NewEtcdV3Discovery ¶
func NewEtcdV3Discovery(basePath string, servicePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)
NewEtcdV3Discovery returns a new EtcdV3Discovery.
func NewEtcdV3DiscoveryStore ¶
func NewEtcdV3DiscoveryStore(basePath string, kv store.Store, allowKeyNotFound bool) (client.ServiceDiscovery, error)
NewEtcdV3DiscoveryStore return a new EtcdV3Discovery with specified store.
func NewEtcdV3DiscoveryTemplate ¶
func NewEtcdV3DiscoveryTemplate(basePath string, etcdAddr []string, allowKeyNotFound bool, options *store.Config) (client.ServiceDiscovery, error)
NewEtcdV3DiscoveryTemplate returns a new EtcdV3Discovery template.
Types ¶
type EtcdDiscovery ¶
type EtcdDiscovery struct { // -1 means it always retry to watch until zookeeper is ok, 0 means no retry. RetriesAfterWatchFailed int AllowKeyNotFound bool // contains filtered or unexported fields }
EtcdDiscovery is a etcd service discovery. It always returns the registered servers in etcd.
func (*EtcdDiscovery) Clone ¶
func (d *EtcdDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
Clone clones this ServiceDiscovery with new servicePath.
func (*EtcdDiscovery) Close ¶
func (d *EtcdDiscovery) Close()
func (*EtcdDiscovery) GetServices ¶
func (d *EtcdDiscovery) GetServices() []*client.KVPair
GetServices returns the servers
func (*EtcdDiscovery) RemoveWatcher ¶
func (d *EtcdDiscovery) RemoveWatcher(ch chan []*client.KVPair)
func (*EtcdDiscovery) SetFilter ¶
func (d *EtcdDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
SetFilter sets the filer.
func (*EtcdDiscovery) WatchService ¶
func (d *EtcdDiscovery) WatchService() chan []*client.KVPair
WatchService returns a nil chan.
type EtcdV3Discovery ¶
type EtcdV3Discovery struct { // -1 means it always retry to watch until zookeeper is ok, 0 means no retry. RetriesAfterWatchFailed int AllowKeyNotFound bool // contains filtered or unexported fields }
EtcdV3Discovery is a etcd service discovery. It always returns the registered servers in etcd.
func (*EtcdV3Discovery) Clone ¶
func (d *EtcdV3Discovery) Clone(servicePath string) (client.ServiceDiscovery, error)
Clone clones this ServiceDiscovery with new servicePath.
func (*EtcdV3Discovery) Close ¶
func (d *EtcdV3Discovery) Close()
func (*EtcdV3Discovery) GetServices ¶
func (d *EtcdV3Discovery) GetServices() []*client.KVPair
GetServices returns the servers
func (*EtcdV3Discovery) RemoveWatcher ¶
func (d *EtcdV3Discovery) RemoveWatcher(ch chan []*client.KVPair)
func (*EtcdV3Discovery) SetFilter ¶
func (d *EtcdV3Discovery) SetFilter(filter client.ServiceDiscoveryFilter)
SetFilter sets the filer.
func (*EtcdV3Discovery) WatchService ¶
func (d *EtcdV3Discovery) WatchService() chan []*client.KVPair
WatchService returns a nil chan.