registry

package
v0.0.0-...-dcebd05 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	AddAddr    string
	DeleteAddr string
}

Event 服务变化事件

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry 名字服务

func New

func New(prefix string, endpoints []string) (*Registry, error)

func (*Registry) GetAddrs

func (r *Registry) GetAddrs(ctx context.Context) ([]string, error)

GetAddrs 获取节点地址列表

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, addr string) error

Register 注册服务

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context) <-chan Event

Watch 发现服务

Jump to

Keyboard shortcuts

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