service

package
v1.1.8-0...-5ee8a8c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

Discovery inwrap for clientv3 of etcd

func NewDiscovery

func NewDiscovery(c *conf.DiscoveryConf) (*Discovery, error)

NewDiscovery create an clientv3 of etcd

func (*Discovery) Name

func (d *Discovery) Name(key string) string

Name get service name

func (*Discovery) Names

func (d *Discovery) Names(key string) []string

Names get service all name

func (*Discovery) Stop

func (d *Discovery) Stop()

Stop shuts down the client's etcd connections.

func (*Discovery) Sync

func (d *Discovery) Sync() error

Sync sync all service nodes

func (*Discovery) Watch

func (d *Discovery) Watch()

Watch watch change of all service nodes

type Registry

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

Registry inwrap for clientv3 of etcd

func NewRegistry

func NewRegistry(c *conf.RegistryConf) (*Registry, error)

NewRegistry create an clientv3 of etcd

func (*Registry) Close

func (r *Registry) Close() error

Close inwrap for clientv3.Close of etcd

func (*Registry) Compact

func (r *Registry) Compact(ctx context.Context, rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error)

Compact inwrap for clientv3.Compact of etcd

func (*Registry) Delete

func (r *Registry) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)

Delete inwrap for clientv3.Delete of etcd

func (*Registry) Do

Do inwrap for clientv3.Do of etcd

func (*Registry) Get

func (r *Registry) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)

Get inwrap for clientv3.Get of etcd

func (*Registry) KeepAlive

func (r *Registry) KeepAlive() error

KeepAlive start keepAlive

func (*Registry) Put

func (r *Registry) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)

Put inwrap for clientv3.Put of etcd

func (*Registry) RequestProgress

func (r *Registry) RequestProgress(ctx context.Context) error

RequestProgress inwrap for clientv3.RequestProgress of etcd

func (*Registry) Start

func (r *Registry) Start() error

Start start keepAlive and discovery

func (*Registry) Stop

func (r *Registry) Stop()

Stop stop keepAlive

func (*Registry) Txn

func (r *Registry) Txn(ctx context.Context) clientv3.Txn

Txn inwrap for clientv3.Txn of etcd

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan

Watch inwrap for clientv3.Watch of etcd

Jump to

Keyboard shortcuts

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