discov

package
v1.1.2-0...-f7e2eea Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeToLive = timeToLive

Functions

This section is empty.

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

func (*Publisher) KeepAlive

func (p *Publisher) KeepAlive() error

func (*Publisher) Pause

func (p *Publisher) Pause()

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 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