package internal
import "sigs.k8s.io/controller-runtime/pkg/internal/source"
Index ¶
- type EventHandler
- func NewEventHandler[object client.Object, request comparable]( ctx context.Context, queue workqueue.TypedRateLimitingInterface[request], handler handler.TypedEventHandler[object, request], predicates []predicate.TypedPredicate[object]) *EventHandler[object, request]
- func (e *EventHandler[object, request]) OnAdd(obj interface{}, isInInitialList bool)
- func (e *EventHandler[object, request]) OnDelete(obj interface{})
- func (e *EventHandler[object, request]) OnUpdate(oldObj, newObj interface{})
- type Kind
Types ¶
type EventHandler ¶
type EventHandler[object client.Object, request comparable] struct { // contains filtered or unexported fields }
EventHandler adapts a handler.EventHandler interface to a cache.ResourceEventHandler interface.
func NewEventHandler ¶
func NewEventHandler[object client.Object, request comparable]( ctx context.Context, queue workqueue.TypedRateLimitingInterface[request], handler handler.TypedEventHandler[object, request], predicates []predicate.TypedPredicate[object]) *EventHandler[object, request]
NewEventHandler creates a new EventHandler.
func (*EventHandler[object, request]) OnAdd ¶
func (e *EventHandler[object, request]) OnAdd(obj interface{}, isInInitialList bool)
OnAdd creates CreateEvent and calls Create on EventHandler.
func (*EventHandler[object, request]) OnDelete ¶
func (e *EventHandler[object, request]) OnDelete(obj interface{})
OnDelete creates DeleteEvent and calls Delete on EventHandler.
func (*EventHandler[object, request]) OnUpdate ¶
func (e *EventHandler[object, request]) OnUpdate(oldObj, newObj interface{})
OnUpdate creates UpdateEvent and calls Update on EventHandler.
type Kind ¶
type Kind[object client.Object, request comparable] struct { // Type is the type of object to watch. e.g. &v1.Pod{} Type object // Cache used to watch APIs Cache cache.Cache Handler handler.TypedEventHandler[object, request] Predicates []predicate.TypedPredicate[object] // contains filtered or unexported fields }
Kind is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create).
func (*Kind[object, request]) Start ¶
func (ks *Kind[object, request]) Start(ctx context.Context, queue workqueue.TypedRateLimitingInterface[request]) error
Start is internal and should be called only by the Controller to register an EventHandler with the Informer to enqueue reconcile.Requests.
func (*Kind[object, request]) String ¶
func (*Kind[object, request]) WaitForSync ¶
WaitForSync implements SyncingSource to allow controllers to wait with starting workers until the cache is synced.
Source Files ¶
event_handler.go kind.go
- Version
- v0.21.0 (latest)
- Published
- May 20, 2025
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 10 hours ago –
Tools for package owners.