Back to

Package etcd

Latest Go to latest

The latest major version is .

Published: Jun 11, 2020 | License: MIT | Module:



var (

	//ErrDuplication is a register duplication err
	ErrDuplication = errors.New("etcd: instance duplicate registration")

func Build

func Build(c *clientv3.Config, id string) naming.Resolver

Build register resolver into default etcd.

func Builder

func Builder(c *clientv3.Config) naming.Builder

Builder return default etcd resolver builder.

type EtcdBuilder

type EtcdBuilder struct {
	// contains filtered or unexported fields

EtcdBuilder is a etcd clientv3 EtcdBuilder

func New

func New(c *clientv3.Config) (e *EtcdBuilder, err error)

New is new a etcdbuilder

func (*EtcdBuilder) Build

func (e *EtcdBuilder) Build(appid string, opts ...naming.BuildOpt) naming.Resolver

Build disovery resovler builder.

func (*EtcdBuilder) Close

func (e *EtcdBuilder) Close() error

Close stop all running process including etcdfetch and register

func (*EtcdBuilder) Register

func (e *EtcdBuilder) Register(ctx context.Context, ins *naming.Instance) (cancelFunc context.CancelFunc, err error)

Register is register instance

func (*EtcdBuilder) Scheme

func (e *EtcdBuilder) Scheme() string

Scheme return etcd's scheme

type Resolve

type Resolve struct {
	// contains filtered or unexported fields

Resolve etch resolver.

func (*Resolve) Close

func (r *Resolve) Close() error

Close close resolver.

func (*Resolve) Fetch

func (r *Resolve) Fetch(ctx context.Context) (ins *naming.InstancesInfo, ok bool)

Fetch fetch resolver instance.

func (*Resolve) Watch

func (r *Resolve) Watch() <-chan struct{}

Watch watch instance.

Package Files

  • etcd.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier