client-go: kmodules.xyz/client-go/dynamic/informer Index | Files

package informer

import "kmodules.xyz/client-go/dynamic/informer"

Index

Package Files

factory.go informer.go

type ResourceInformer Uses

type ResourceInformer struct {
    // contains filtered or unexported fields
}

ResourceInformer represents a "subscription" to a shared informer and lister.

Users of this package shouldn't create ResourceInformers directly. The SharedInformerFactory returns a new ResourceInformer for each request, but multiple ResourceInformers may share the same underlying informer if they are for the same apiVersion and resource.

When you're done with a ResourceInformer, you should call Close() on it. Once all ResourceInformers for a shared informer are closed, the shared informer is stopped.

func (*ResourceInformer) Close Uses

func (ri *ResourceInformer) Close()

Close marks this ResourceInformer as unused, allowing the underlying shared informer to be stopped when no users are left. You should call this when you no longer need the informer, so the watches and relists can be stopped.

func (*ResourceInformer) Informer Uses

func (ri *ResourceInformer) Informer() SharedIndexInformer

Informer returns an interface to the dynamic, shared informer. If you add any event handlers with this interface, you should arrange to call RemoveEventHandlers() when you want to stop receiving events.

func (*ResourceInformer) Lister Uses

func (ri *ResourceInformer) Lister() *dynamiclister.Lister

Lister returns a shared, dynamic lister that's analogous to the static listers generated for static types.

type SharedIndexInformer Uses

type SharedIndexInformer interface {
    cache.SharedIndexInformer

    // RemoveEventHandlers removes all event handlers added through this instance
    // of SharedIndexInformer. It does not affect other handlers on the same
    // underlying shared informer.
    //
    // This is necessary because the underlying shared informer may continue
    // running if others are using it, so you should remove the handlers you added
    // when you're no longer interested in receiving events.
    RemoveEventHandlers()
}

SharedIndexInformer is an extension of the standard interface of the same name, adding the ability to remove event handlers that you added.

type SharedInformerFactory Uses

type SharedInformerFactory struct {
    // contains filtered or unexported fields
}

SharedInformerFactory is a factory for requesting dynamic informers from a shared pool. It's analogous to the static SharedInformerFactory generated for static types.

func NewSharedInformerFactory Uses

func NewSharedInformerFactory(clientset *dynamicclientset.Clientset, defaultResync time.Duration) *SharedInformerFactory

NewSharedInformerFactory creates a new factory for shared, dynamic informers. Usually there is only one of these for the whole process, created in main().

func (*SharedInformerFactory) Resource Uses

func (f *SharedInformerFactory) Resource(apiVersion, resource string) (*ResourceInformer, error)

Resource returns a dynamic informer and lister for the given resource. These are shared with any other controllers in the same process that request the same resource.

If this function returns successfully, the caller should ensure they call Close() on the returned ResourceInformer when they no longer need it. Shared informers that become unused will be stopped to minimize our load on the API server.

Package informer imports 14 packages (graph). Updated 2020-09-30. Refresh now. Tools for package owners.