Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionEtcd ¶
type OptionEtcd struct { Address []string Timeout time.Duration Client *clientv3.Client Node map[string]Options //服务信息(key=服务名称) Context context.Context }
func (*OptionEtcd) DiscoverInfo ¶
func (o *OptionEtcd) DiscoverInfo(opt Options) (*Options, error)
func (*OptionEtcd) DiscoverList ¶
func (o *OptionEtcd) DiscoverList() (map[string]Options, error)
func (*OptionEtcd) Unregister ¶
func (o *OptionEtcd) Unregister(opt Options) error
Unregister 反注册,获取当前服务名称的所有节点,删除当前地址的节点
func (*OptionEtcd) Watch ¶
func (o *OptionEtcd) Watch(opt Options) error
type Registry ¶
type Registry interface { Register(Options) (*string, error) //注册 Unregister(Options) error //反注册 DiscoverInfo(Options) (*Options, error) //发现单服务 DiscoverList() (map[string]Options, error) //发现所有服务 Watch(Options) error //监控 }
func NewRegister ¶
func NewRegister(opt OptionEtcd) Registry
Click to show internal directories.
Click to hide internal directories.