kratos: github.com/bilibili/kratos/pkg/naming/etcd Index | Files

package etcd

import "github.com/bilibili/kratos/pkg/naming/etcd"

Index

Package Files

etcd.go

Variables

var (

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

func Build Uses

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

Build register resolver into default etcd.

func Builder Uses

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

Builder return default etcd resolver builder.

type EtcdBuilder Uses

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

EtcdBuilder is a etcd clientv3 EtcdBuilder

func New Uses

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

New is new a etcdbuilder

func (*EtcdBuilder) Build Uses

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

Build disovery resovler builder.

func (*EtcdBuilder) Close Uses

func (e *EtcdBuilder) Close() error

Close stop all running process including etcdfetch and register

func (*EtcdBuilder) Register Uses

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

Register is register instance

func (*EtcdBuilder) Scheme Uses

func (e *EtcdBuilder) Scheme() string

Scheme return etcd's scheme

type Resolve Uses

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

Resolve etch resolver.

func (*Resolve) Close Uses

func (r *Resolve) Close() error

Close close resolver.

func (*Resolve) Fetch Uses

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

Fetch fetch resolver instance.

func (*Resolve) Watch Uses

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

Watch watch instance.

Package etcd imports 15 packages (graph). Updated 2019-11-13. Refresh now. Tools for package owners.