Help us shape the future of Go! Take the 2026 Go Developer Survey

watcher

package
v0.3.308 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeEventKey added in v0.2.256

func MakeEventKey(e watch.Event) string

MakeEventKey creates a unique key for an event from a watcher

Types

type Adaptor

type Adaptor interface {
	WatchResources
	Watcher
}

type AdaptorMock

type AdaptorMock struct {
	WatcherMock
	WatchResource []WatchResourceMock
}

func (*AdaptorMock) WatchResources

func (am *AdaptorMock) WatchResources() []WatchResource

type WatchResource

type WatchResource interface {
	GroupVersionResource() schema.GroupVersionResource
	ListOptions() metav1.ListOptions
}

type WatchResourceImpl

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

func NewWatchResource

func NewWatchResource(groupVersionResource schema.GroupVersionResource, listOptions metav1.ListOptions) *WatchResourceImpl

func (*WatchResourceImpl) GroupVersionResource

func (wr *WatchResourceImpl) GroupVersionResource() schema.GroupVersionResource

func (*WatchResourceImpl) ListOptions

func (wr *WatchResourceImpl) ListOptions() metav1.ListOptions

type WatchResourceMock

type WatchResourceMock struct {
	ListOpt metav1.ListOptions
	Schema  schema.GroupVersionResource
}

func (*WatchResourceMock) GroupVersionResource

func (rm *WatchResourceMock) GroupVersionResource() schema.GroupVersionResource

func (*WatchResourceMock) ListOptions

func (rm *WatchResourceMock) ListOptions() metav1.ListOptions

type WatchResources

type WatchResources interface {
	WatchResources() []WatchResource
}

type WatchResourcesMock

type WatchResourcesMock struct{}

func (*WatchResourcesMock) WatchResources

func (rm *WatchResourcesMock) WatchResources() []WatchResource

type Watcher

type Watcher interface {
	AddHandler(ctx context.Context, obj runtime.Object)
	ModifyHandler(ctx context.Context, obj runtime.Object)
	DeleteHandler(ctx context.Context, obj runtime.Object)
}

type WatcherMock

type WatcherMock struct {
	Added   chan runtime.Object
	Updated chan runtime.Object
	Deleted chan runtime.Object
}

func NewWatcherMock

func NewWatcherMock() *WatcherMock

func (*WatcherMock) AddHandler

func (wm *WatcherMock) AddHandler(_ context.Context, obj runtime.Object)

func (*WatcherMock) DeleteHandler

func (wm *WatcherMock) DeleteHandler(_ context.Context, obj runtime.Object)

func (*WatcherMock) ModifyHandler

func (wm *WatcherMock) ModifyHandler(_ context.Context, obj runtime.Object)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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