Documentation ¶
Overview ¶
Package informer provides generic utilities to work with Kubernetes informers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Informer ¶
type Informer struct {
// contains filtered or unexported fields
}
Informer is a generic wrapper around the controller-runtime cache. It provides a minimalist interface for watching Kubernetes objects and triggering callbacks.
func (*Informer) OnAdd ¶
func (i *Informer) OnAdd(cb func(obj interface{}))
OnAdd is triggered when an object is added.
func (*Informer) OnDelete ¶
func (i *Informer) OnDelete(cb func(obj interface{}))
OnDelete is triggered when an object is deleted.
type OptionsFunc ¶
type OptionsFunc func(*Informer)
OptionsFunc is a function that sets options for the informer.
func Watches ¶
func Watches(obj client.Object, ns ...string) OptionsFunc
Watches sets the Informer to watch the given object. If a namespace is provided, the Informer will only watch the object only in that namespace.
func WithConfig ¶
func WithConfig(cfg *rest.Config) OptionsFunc
WithConfig sets the rest.Config for the Informer.
func WithLogger ¶
func WithLogger(l *zap.SugaredLogger) OptionsFunc
WithLogger sets the logger for the Informer.