controllers

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract[T Object](obj any) T

func IsNil

func IsNil[O comparable](o O) bool

Types

type ComparableObject

type ComparableObject interface {
	comparable
	Object
}

type EventHandler

type EventHandler[T Object] struct {
	AddFunc         func(obj T)
	AddExtendedFunc func(obj T, initialSync bool)
	UpdateFunc      func(oldObj, newObj T)
	DeleteFunc      func(obj T)
}

func (EventHandler[T]) OnAdd

func (e EventHandler[T]) OnAdd(obj interface{}, initialSync bool)

func (EventHandler[T]) OnDelete

func (e EventHandler[T]) OnDelete(obj interface{})

func (EventHandler[T]) OnUpdate

func (e EventHandler[T]) OnUpdate(oldObj, newObj interface{})

type EventType

type EventType int
const (
	// EventAdd is sent when an object is added
	EventAdd EventType = iota

	// EventUpdate is sent when an object is modified
	// Captures the modified object
	EventUpdate

	// EventDelete is sent when an object is deleted
	// Captures the object at the last known state
	EventDelete
)

func (EventType) String

func (event EventType) String() string

type Object

type Object interface {
	metav1.Object
	runtime.Object
}

Jump to

Keyboard shortcuts

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