informer

package
v0.0.0-...-65c2b02 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFunc

type AddFunc func(obj interface{})

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 ListFunc

type ListFunc func(options v1.ListOptions, namespace string) (runtime.Object, error)

type UpdateFunc

type UpdateFunc func(newObj interface{}, oldObj interface{})

type WatchFunc

type WatchFunc func(options v1.ListOptions, namespace string) (watch.Interface, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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