Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster[E any] interface { Subscribe(ch chan *E, filters ...func(event *E) bool) func() OnAdd(any, bool) OnUpdate(any, any) OnDelete(any) }
Broadcaster is an interface for broadcasting informer watch events to multiple subscribers. T is the resource type (e.g., Application), E is the event type (e.g., ApplicationWatchEvent).
type EventFunc ¶
EventFunc creates a watch event from an object and event type. T is the resource type (e.g., Application), E is the event type (e.g., ApplicationWatchEvent).
type Handler ¶
Handler is a generic broadcaster handler that can be used for any resource type. T is the resource type (e.g., Application), E is the event type (e.g., ApplicationWatchEvent).
func NewHandler ¶
func NewHandler[T any, E any](eventFunc EventFunc[T, E], logFields LogFieldsFunc[T]) *Handler[T, E]
NewHandler creates a new generic broadcaster handler. T is the resource type (e.g., Application), E is the event type (e.g., ApplicationWatchEvent).
type LogFieldsFunc ¶
LogFieldsFunc returns log fields for an object (for logging dropped events)