watcher

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWatchFuncNotExists     = errors.New("watchKeyFunc not exists")
	ErrWatchFuncAlreadyExists = errors.New("watchKeyFunc already exists")
)

Functions

This section is empty.

Types

type PlanHandlerFunc

type PlanHandlerFunc func(typeWatch, key string) func(idx uint64, raw any)

type UnwatchKeyFunc

type UnwatchKeyFunc func() error

type WatchKeyFunc

type WatchKeyFunc func(key, sessionID string, value []byte)

type WatchKeys

type WatchKeys map[string]WatchKeyFunc

type WatchPrefixKey

type WatchPrefixKey map[string]WatchPrefixKeyFunc

type WatchPrefixKeyFunc

type WatchPrefixKeyFunc func(params map[string][]byte)

type Watcher

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

func NewWatcher

func NewWatcher(cli *api.Client, logger *zap.Logger) *Watcher

func (*Watcher) Start

func (w *Watcher) Start(_ context.Context) error

func (*Watcher) Stop

func (w *Watcher) Stop(_ context.Context) error

func (*Watcher) WatchKeys

func (w *Watcher) WatchKeys(keys WatchKeys) error

func (*Watcher) WatchPrefixKeys

func (w *Watcher) WatchPrefixKeys(keys WatchPrefixKey) error

Jump to

Keyboard shortcuts

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