etcd

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

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

Functions

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.

Types

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.

Jump to

Keyboard shortcuts

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