etcd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(conf config.EtcdCliConf) string

NewResolver initialize an etcd client

Types

type Builder

type Builder struct {
	config.Auth
	// contains filtered or unexported fields
}

func (*Builder) Build

func (r *Builder) Build(target resolver.Target, clientConn resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error)

func (*Builder) Scheme

func (r *Builder) Scheme() string

type Register

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

Register ...

func NewRegister

func NewRegister(conf config.EtcdSrvConf) (*Register, error)

NewRegister naming.Update{Op: naming.Add, Addr: "1.2.3.4", Metadata: "..."})

func (*Register) Deregister

func (r *Register) Deregister() error

Deregister remove service from etcd

func (*Register) GetFullAddress

func (r *Register) GetFullAddress() string

func (*Register) GetServiceAddress

func (r *Register) GetServiceAddress() string

func (*Register) GetServiceName

func (r *Register) GetServiceName() string

func (*Register) Register

func (r *Register) Register() error

Register register service with name as prefix to etcd, multi etcd addr should use ; to split

func (*Register) SetInterval

func (r *Register) SetInterval(interval time.Duration)

func (*Register) SetLeaseTime

func (r *Register) SetLeaseTime(leaseTime int64)

type Resolver

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

func (*Resolver) Close

func (r *Resolver) Close()

It's just a hint, resolver can ignore this if it's not necessary.

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(opt resolver.ResolveNowOption)

ResolveNow will be called by gRPC to try to resolve the target name again. It's just a hint, resolver can ignore this if it's not necessary.

It could be called multiple times concurrently.

Jump to

Keyboard shortcuts

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