Documentation ¶
Index ¶
- type AddFunc
- type DeleteFunc
- type FilterFunc
- type GenericInformer
- func (i *GenericInformer) AddNamespace(namespace string) error
- func (i *GenericInformer) Indexer() cache.Indexer
- func (i *GenericInformer) IsRunning() bool
- func (i *GenericInformer) IsSynced() bool
- func (i *GenericInformer) RemoveNamespace(namespace string) error
- func (i *GenericInformer) Start(ctx context.Context) error
- func (i *GenericInformer) Stop() error
- type InformerOption
- func WithAddCallback(f AddFunc) InformerOption
- func WithDeleteCallback(f DeleteFunc) InformerOption
- func WithFieldSelector(sel string) InformerOption
- func WithFilterFunc(f FilterFunc) InformerOption
- func WithLabelSelector(sel string) InformerOption
- func WithListCallback(f ListFunc) InformerOption
- func WithNamespaces(namespaces ...string) InformerOption
- func WithResyncPeriod(t time.Duration) InformerOption
- func WithUpdateCallback(f UpdateFunc) InformerOption
- func WithWatchCallback(f WatchFunc) InformerOption
- type ListFunc
- type UpdateFunc
- type WatchFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteFunc ¶
type DeleteFunc func(obj interface{})
type FilterFunc ¶
type FilterFunc func(obj interface{}) bool
type GenericInformer ¶
type GenericInformer struct {
// contains filtered or unexported fields
}
func NewGenericInformer ¶
func NewGenericInformer(objType runtime.Object, options ...InformerOption) (*GenericInformer, error)
NewGenericInformer returns a new instance of a GenericInformer for the given object type and with the given objects.
func (*GenericInformer) AddNamespace ¶
func (i *GenericInformer) AddNamespace(namespace string) error
AddNamespace adds a namespace to the list of allowed namespaces.
func (*GenericInformer) Indexer ¶
func (i *GenericInformer) Indexer() cache.Indexer
Indexer returns the underlying shared informer's indexer
func (*GenericInformer) IsRunning ¶
func (i *GenericInformer) IsRunning() bool
IsRunning returns whether the GenericInformer is running or not
func (*GenericInformer) IsSynced ¶
func (i *GenericInformer) IsSynced() bool
IsSynced returns whether the informer is considered to be in sync or not
func (*GenericInformer) RemoveNamespace ¶
func (i *GenericInformer) RemoveNamespace(namespace string) error
RemoveNamespace removes a namespace from the list of allowed namespaces
func (*GenericInformer) Start ¶
func (i *GenericInformer) Start(ctx context.Context) error
Start starts the GenericInformer with its current options in a goroutine. If this method does not return an error, you can use Stop to stop the informer and terminate the goroutine it has created. If Start returns an error, no goroutine will have been created.
func (*GenericInformer) Stop ¶
func (i *GenericInformer) Stop() error
Stop stops the GenericInformer and terminates the associated goroutine.
type InformerOption ¶
type InformerOption func(i *GenericInformer) error
func WithAddCallback ¶
func WithAddCallback(f AddFunc) InformerOption
func WithDeleteCallback ¶
func WithDeleteCallback(f DeleteFunc) InformerOption
func WithFieldSelector ¶
func WithFieldSelector(sel string) InformerOption
func WithFilterFunc ¶
func WithFilterFunc(f FilterFunc) InformerOption
func WithLabelSelector ¶
func WithLabelSelector(sel string) InformerOption
func WithListCallback ¶
func WithListCallback(f ListFunc) InformerOption
func WithNamespaces ¶
func WithNamespaces(namespaces ...string) InformerOption
WithNamespaces sets the namespaces for which the informer will process any event. If an event is seen for an object in a namespace that is not in this list, the event will be ignored. If either zero or multiple namespaces are set, the informer will require cluster-wide permissions to list and watch the kind of resource to be handled by this informer.
func WithResyncPeriod ¶
func WithResyncPeriod(t time.Duration) InformerOption
func WithUpdateCallback ¶
func WithUpdateCallback(f UpdateFunc) InformerOption
func WithWatchCallback ¶
func WithWatchCallback(f WatchFunc) InformerOption
type UpdateFunc ¶
type UpdateFunc func(newObj interface{}, oldObj interface{})