Documentation ¶
Overview ¶
Package etcd is registered as a service using etcd.
Index ¶
- func NewRegistry(etcdEndpoints []string, id string, instanceName string, ...) (registry.Registry, *registry.ServiceInstance, error)
- type Option
- type Registry
- func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error
- func (r *Registry) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error)
- func (r *Registry) IsServiceRegistered(ctx context.Context, key string) (bool, error)
- func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error
- func (r *Registry) Watch(ctx context.Context, name string) (registry.Watcher, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRegistry ¶
func NewRegistry(etcdEndpoints []string, id string, instanceName string, instanceEndpoints []string, opts ...etcdcli.Option) (registry.Registry, *registry.ServiceInstance, error)
NewRegistry instantiating the etcd registry Note: If the etcdcli.WithConfig(*clientv3.Config) parameter is set, the etcdEndpoints parameter is ignored!
Types ¶
type Option ¶
type Option func(o *options)
Option is etcd registry option.
func WithRegisterTTL ¶
WithRegisterTTL with register ttl.
type Registry ¶
Registry is etcd registry.
func (*Registry) Deregister ¶
Deregister the registration.
func (*Registry) GetService ¶
func (r *Registry) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error)
GetService return the service instances in memory according to the service name.
func (*Registry) IsServiceRegistered ¶ added in v1.0.51
IsServiceRegistered 检查给定的服务实例是否已注册。
Click to show internal directories.
Click to hide internal directories.