etcd

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSubscriber

func NewSubscriber(client *clientv3.Client, options ...func(*subscriber)) *subscriber

NewSubscriber generates a Daemon with a watcher constructed using the given etcd config

func WithLogger

func WithLogger(logger *logrus.Logger) func(*subscriber)

WithLogger creates an option to configure a subscriber with a logging handle.

func WithRetryInterval

func WithRetryInterval(interval time.Duration) func(*subscriber)

WithRetryInterval configures the duration between retrying handlers that have failed

Types

type Updater

type Updater struct {
	clientv3.KV
	Timeout time.Duration
}

func (Updater) Run

func (e Updater) Run(key, value string) error

Run will update the etcd key with the given value, but only if the value in etcd is different from our desired update. This avoids causing watchers that are subscribed to changes on this key triggering for multiple PUTs of the same value.

Jump to

Keyboard shortcuts

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