etcdutil

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 6 Imported by: 1

README

etcdutil

utility library for etcd watcher & lease

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLeaseInterrupted error = errors.New("lease interrupted")

Functions

This section is empty.

Types

type Lease

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

func NewLease

func NewLease(client *clientv3.Client, key, value string, ttl int64, onError func(error)) (*Lease, error)

func (*Lease) Stop

func (l *Lease) Stop()

type Watcher

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

func NewWatcher

func NewWatcher(client *clientv3.Client, handler WatcherHandler, key string, opts ...clientv3.OpOption) *Watcher

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) Stop

func (w *Watcher) Stop() error

type WatcherHandler

type WatcherHandler interface {
	OnPut(key, value []byte)
	OnDelete(key []byte)
	OnError(error)
	OnResetBegin()
	OnResetEnd()
}

Jump to

Keyboard shortcuts

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