watchhook

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHook

func AddHook(hook *WatchHook) error

func DeleteHook

func DeleteHook(id string) error

func Trigger

func Trigger(e watch.Event)

Trigger trigger the corresponding hook to serve watch based on the event passed in

Types

type ChanReceiver

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

func NewChanReceiver

func NewChanReceiver(ch chan<- watch.Event) *ChanReceiver

func (*ChanReceiver) Receive

func (hc *ChanReceiver) Receive(event watch.Event) error

type Receiver

type Receiver interface {
	Receive(event watch.Event) error
}

type WatchHook

type WatchHook struct {
	GVR             schema.GroupVersionResource
	Namespace       string
	Name            string
	ResourceVersion uint64

	Receiver
	// contains filtered or unexported fields
}

func NewWatchHook

func NewWatchHook(key string, rev uint64, receiver Receiver) *WatchHook

func (*WatchHook) Do

func (h *WatchHook) Do(event watch.Event) error

func (*WatchHook) GetGVR

func (*WatchHook) GetName

func (h *WatchHook) GetName() string

func (*WatchHook) GetNamespace

func (h *WatchHook) GetNamespace() string

func (*WatchHook) GetResourceVersion

func (h *WatchHook) GetResourceVersion() uint64

func (*WatchHook) Lock

func (h *WatchHook) Lock()

func (*WatchHook) Stop

func (h *WatchHook) Stop()

func (*WatchHook) UnLock

func (h *WatchHook) UnLock()

Jump to

Keyboard shortcuts

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