watcher

package
v1.1.24 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 12 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 {
	// contains filtered or unexported fields
}

General a base watcher this will be use for most watchers

func New added in v1.1.3

func New(opts ...Option) (w *General, err error)

New returns a new General watcher with handler

func (*General) Close added in v1.1.3

func (w *General) Close() error

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

func WrapInstance added in v1.1.3

func WrapInstance(prefix string, pipeName string) Handler

func WrapNode added in v1.1.3

func WrapNode(prefix string, nodeName string) Handler

func WrapNodeStatus added in v1.1.3

func WrapNodeStatus(prefix string, name string) Handler

func WrapPipeline added in v1.1.3

func WrapPipeline(prefix string, pipeName string) Handler

func WrapSchedulerBinding added in v1.1.3

func WrapSchedulerBinding() Handler

func WrapStrHandler added in v1.1.3

func WrapStrHandler() Handler

type Option added in v1.1.3

type Option func(*Options)

func WithHandler added in v1.1.3

func WithHandler(h Handler) Option

func WithKey added in v1.1.3

func WithKey(k string) Option

type Options added in v1.1.3

type Options struct {
	Key     string
	Handler Handler
}

func NewOptions added in v1.1.3

func NewOptions(opt ...Option) *Options

type Watcher

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

Watcher a wrapper for etcd watcher

Jump to

Keyboard shortcuts

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