watcher

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Event *clientv3.Event
	Data  interface{}
}

Event watcher event

type General

type General struct {
	EventHandler func(*clientv3.Event) (*Event, error)
	// contains filtered or unexported fields
}

General a base watcher this will be use for most watchers

func NewGeneral

func NewGeneral(key string) (w *General, err error)

NewGeneral returns a new General watcher

func (*General) GetKey

func (w *General) GetKey() string

GetKey returns General key

func (*General) WatchEtcd

func (w *General) WatchEtcd(ctx context.Context, opts ...clientv3.OpOption) (ch chan *Event, err error)

WatchEtcd start watch etcd changes

func (*General) WatchEtcdList

func (w *General) WatchEtcdList(ctx context.Context) (ch chan *Event, err error)

WatchEtcdList start watch etcd changes for list

type Handler

type Handler func(*clientv3.Event) (*Event, error)

Handler function of handle event

type Watcher

type Watcher interface {
	Watch() chan model.Model
}

Watcher a wrapper for etcd watcher

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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