watcher

package
v2.0.0-...-73bef05 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 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

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

New returns a new General watcher with handler

func (*General) Close

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

func WrapInstance(prefix string, pipeName string) Handler

func WrapNode

func WrapNode(prefix string, nodeName string) Handler

func WrapNodeStatus

func WrapNodeStatus(prefix string, name string) Handler

func WrapPipeline

func WrapPipeline(prefix string, pipeName string) Handler

func WrapSchedulerBinding

func WrapSchedulerBinding() Handler

func WrapStrHandler

func WrapStrHandler() Handler

type Option

type Option func(*Options)

func WithHandler

func WithHandler(h Handler) Option

func WithKey

func WithKey(k string) Option

type Options

type Options struct {
	Key     string
	Handler Handler
}

func NewOptions

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