etcdv3

package
v1.10.27 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeToLive = timeToLive

Functions

func NewBuilder

func NewBuilder(scheme string) *builder

Types

type EtcdConf

type EtcdConf struct {
	Hosts []string
	Key   string
}

func (EtcdConf) Validate

func (c EtcdConf) Validate() error

type Facade

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

func NewFacade

func NewFacade(endpoints []string) Facade

func (Facade) Client

func (f Facade) Client() internal.EtcdClient

func (Facade) Monitor

func (f Facade) Monitor(key string, l FacadeListener)

type FacadeListener

type FacadeListener interface {
	OnAdd(key, val string)
	OnDelete(key string)
}

type Publisher

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

func NewPublisher

func NewPublisher(endpoints []string, key, value string, opts ...PublisherOption) (*Publisher, error)

func (*Publisher) Deregister

func (p *Publisher) Deregister() error

func (*Publisher) Pause

func (p *Publisher) Pause()

func (*Publisher) Register

func (p *Publisher) Register() error

func (*Publisher) Resume

func (p *Publisher) Resume()

func (*Publisher) Stop

func (p *Publisher) Stop()

type PublisherOption

type PublisherOption func(client *Publisher)

func WithId

func WithId(id int64) PublisherOption

type Resolver

type Resolver struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

implements grpc.naming.Resolver

func (*Resolver) Close

func (r *Resolver) Close()

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(opts resolver.ResolveNowOptions)

func (*Resolver) Watcher

func (r *Resolver) Watcher()

type SubOption

type SubOption func(opts *subOptions)

func Exclusive

func Exclusive() SubOption

exclusive means that key value can only be 1:1, which means later added value will remove the keys associated with the same value previously.

type Subscriber

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

func NewSubscriber

func NewSubscriber(endpoints []string, key string, opts ...SubOption) (*Subscriber, error)

func (*Subscriber) AddListener

func (s *Subscriber) AddListener(listener func())

func (*Subscriber) Values

func (s *Subscriber) Values() []string

Directories

Path Synopsis
Package internal is a generated GoMock package.
Package internal is a generated GoMock package.

Jump to

Keyboard shortcuts

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