informer

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 21 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicDiscoverySharedInformerFactory

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

DynamicDiscoverySharedInformerFactory is a SharedInformerFactory that dynamically discovers new types and begins informing on them.

func NewDynamicDiscoverySharedInformerFactory

func NewDynamicDiscoverySharedInformerFactory(
	workspaceLister tenancylisters.ClusterWorkspaceLister,
	disco clusterDiscovery,
	dynClient dynamic.Interface,
	filterFunc func(obj interface{}) bool,
	pollInterval time.Duration,
) *DynamicDiscoverySharedInformerFactory

NewDynamicDiscoverySharedInformerFactory returns a factory for shared informers that discovers new types and informs on updates to resources of those types.

func (*DynamicDiscoverySharedInformerFactory) AddEventHandler added in v0.6.0

func (d *DynamicDiscoverySharedInformerFactory) AddEventHandler(handler GVREventHandler)

func (*DynamicDiscoverySharedInformerFactory) AddIndexers added in v0.6.0

func (d *DynamicDiscoverySharedInformerFactory) AddIndexers(indexers cache.Indexers) error

func (*DynamicDiscoverySharedInformerFactory) InformerForResource added in v0.6.0

InformerForResource returns the GenericInformer for gvr, creating it if needed. The GenericInformer must be started by calling Start on the DynamicDiscoverySharedInformerFactory before the GenericInformer can be used.

func (*DynamicDiscoverySharedInformerFactory) Listers

Listers returns a map of per-resource-type listers for all types that are known by this informer factory, and that are synced.

If any informers aren't synced, their GVRs are returned so that they can be checked and processed later.

func (*DynamicDiscoverySharedInformerFactory) Start

func (d *DynamicDiscoverySharedInformerFactory) Start(_ <-chan struct{})

Start starts any informers that have been created but not yet started. The passed in stop channel is ignored; instead, a new stop channel is created, so the factory can properly stop the informer if/when the API is removed. Like other shared informer factories, this call is non-blocking.

func (*DynamicDiscoverySharedInformerFactory) StartPolling added in v0.6.0

StartPolling starts the polling process that periodically discovers new resources and starts informers for them. This call is non-blocking.

type GVREventHandler

type GVREventHandler interface {
	OnAdd(gvr schema.GroupVersionResource, obj interface{})
	OnUpdate(gvr schema.GroupVersionResource, oldObj, newObj interface{})
	OnDelete(gvr schema.GroupVersionResource, obj interface{})
}

GVREventHandler is an event handler that includes the GroupVersionResource of the resource being handled.

type GVREventHandlerFuncs

type GVREventHandlerFuncs struct {
	AddFunc    func(gvr schema.GroupVersionResource, obj interface{})
	UpdateFunc func(gvr schema.GroupVersionResource, oldObj, newObj interface{})
	DeleteFunc func(gvr schema.GroupVersionResource, obj interface{})
}

func (GVREventHandlerFuncs) OnAdd

func (g GVREventHandlerFuncs) OnAdd(gvr schema.GroupVersionResource, obj interface{})

func (GVREventHandlerFuncs) OnDelete

func (g GVREventHandlerFuncs) OnDelete(gvr schema.GroupVersionResource, obj interface{})

func (GVREventHandlerFuncs) OnUpdate

func (g GVREventHandlerFuncs) OnUpdate(gvr schema.GroupVersionResource, oldObj, newObj interface{})

Jump to

Keyboard shortcuts

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