watchhook

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

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, error)

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