Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EtcdV3Discovery ¶
type EtcdV3Discovery struct { BasePath string // -1 means it always retry to watch until zookeeper is ok, 0 means no retry. RetriesAfterWatchFailed int // contains filtered or unexported fields }
EtcdV3Discovery is an etcd service discovery. It always returns the registered servers in etcd.
func (*EtcdV3Discovery) Close ¶
func (d *EtcdV3Discovery) Close()
func (*EtcdV3Discovery) GetServices ¶
func (d *EtcdV3Discovery) GetServices() []*base.ServiceInstance
GetServices returns the servers
func (*EtcdV3Discovery) RemoveWatcher ¶
func (d *EtcdV3Discovery) RemoveWatcher(ch chan []*base.ServiceInstance)
func (*EtcdV3Discovery) WatchService ¶
func (d *EtcdV3Discovery) WatchService() <-chan []*base.ServiceInstance
WatchService returns a nil chan.
type EtcdV3Registry ¶
type EtcdV3Registry struct { BasePath string ServiceAddress string EtcdServers []string Services []string UpdateInterval time.Duration Expired time.Duration // contains filtered or unexported fields }
EtcdV3Registry implements etcd registry.
func (*EtcdV3Registry) Register ¶
func (r *EtcdV3Registry) Register(ctx context.Context, serviceInstance *base.ServiceInstance) error
func (*EtcdV3Registry) Unregister ¶
func (r *EtcdV3Registry) Unregister(ctx context.Context, name string) (err error)
Unregister the name service
func (*EtcdV3Registry) UnregisterAllService ¶
func (r *EtcdV3Registry) UnregisterAllService(ctx context.Context) error
UnregisterAllService unregister all services.
Click to show internal directories.
Click to hide internal directories.