Documentation
¶
Index ¶
- func NewCRDGVRSource(informer cache.SharedIndexInformer) (*crdGVRSource, error)
- type DiscoveringDynamicSharedInformerFactory
- type GVREventHandler
- type GVREventHandlerFuncs
- type GVRPartialMetadata
- type GVRSource
- type GenericDiscoveringDynamicSharedInformerFactory
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) AddEventHandler(handler GVREventHandler)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ForResource(gvr schema.GroupVersionResource) (GenericInformer, error)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Informers() (informers map[schema.GroupVersionResource]GenericInformer, ...)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) RESTMapper() meta.ResettableRESTMapper
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredResources() ([]*metav1.APIResourceList, error)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Start(_ <-chan struct{})
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) StartWorker(ctx context.Context)
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Subscribe(id string) <-chan struct{}
- func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Unsubscribe(id string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCRDGVRSource ¶ added in v0.11.0
func NewCRDGVRSource(informer cache.SharedIndexInformer) (*crdGVRSource, error)
NewCRDGVRSource returns a GVRSource based on CRDs watched in the given informer.
Types ¶
type DiscoveringDynamicSharedInformerFactory ¶ added in v0.11.0
type DiscoveringDynamicSharedInformerFactory struct { *GenericDiscoveringDynamicSharedInformerFactory[kcpcache.ScopeableSharedIndexInformer, kcpcache.GenericClusterLister, kcpinformers.GenericClusterInformer] }
DiscoveringDynamicSharedInformerFactory is a factory for cluster-aware shared informers that discovers new types and informs on updates to resources of those types. It offers an additional `Cluster()` method that returns a new shared informer factory based on the main informer factory, but scoped for a given logical cluster.
func NewDiscoveringDynamicSharedInformerFactory ¶ added in v0.11.0
func NewDiscoveringDynamicSharedInformerFactory( dynamicClusterClient kcpdynamic.ClusterInterface, filterFunc func(obj interface{}) bool, tweakListOptions dynamicinformer.TweakListOptionsFunc, gvrSource GVRSource, indexers cache.Indexers, ) (*DiscoveringDynamicSharedInformerFactory, error)
NewDiscoveringDynamicSharedInformerFactory returns a factory for cluster-aware shared informers that discovers new types and informs on updates to resources of those types. It receives the GVR-related information by delegating to a GVRSource.
func (*DiscoveringDynamicSharedInformerFactory) Cluster ¶ added in v0.11.0
func (d *DiscoveringDynamicSharedInformerFactory) Cluster(cluster logicalcluster.Name) kcpinformers.ScopedDynamicSharedInformerFactory
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{})
type GVRPartialMetadata ¶ added in v0.11.0
type GVRPartialMetadata struct { Names apiextensionsv1.CustomResourceDefinitionNames Scope apiextensionsv1.ResourceScope }
GVRPartialMetadata provides the required metadata about a GVR for which an informer should be started.
type GVRSource ¶ added in v0.11.0
type GVRSource interface { // GVRs returns the required metadata about all GVRs known by the GVRSource GVRs() map[schema.GroupVersionResource]GVRPartialMetadata // Ready returns true if the GVRSource is ready to return available GVRs. // For informer-based GVRSources (watching CRDs for example), it would return true if the underlying // informer is synced. Ready() bool // Subscribe returns a new channel to which the GVRSource writes whenever // its list of known GVRs has changed Subscribe() <-chan struct{} }
GVRSource is a source of information about available GVRs, and provides a way to register for changes in the available GVRs (addition or removal) so that the list of informers can be updated.
type GenericDiscoveringDynamicSharedInformerFactory ¶ added in v0.11.0
type GenericDiscoveringDynamicSharedInformerFactory[Informer cache.SharedIndexInformer, Lister genericListerBase, GenericInformer genericInformerBase[Informer, Lister]] struct { // contains filtered or unexported fields }
GenericDiscoveringDynamicSharedInformerFactory is a SharedInformerFactory that dynamically discovers new types and begins informing on them. It is a generic implementation for both logical-cluster-aware and logical-cluster-unaware (== single cluster, standard kube) informers.
func NewGenericDiscoveringDynamicSharedInformerFactory ¶ added in v0.11.0
func NewGenericDiscoveringDynamicSharedInformerFactory[Informer cache.SharedIndexInformer, Lister genericListerBase, GenericInformer genericInformerBase[Informer, Lister]]( newInformer func(gvr schema.GroupVersionResource, resyncPeriod time.Duration, indexers cache.Indexers) GenericInformer, filterFunc func(obj interface{}) bool, gvrSource GVRSource, indexers cache.Indexers, ) (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer], error)
NewGenericDiscoveringDynamicSharedInformerFactory returns is an informer factory that dynamically discovers new types and begins informing on them. It is a generic implementation for both logical-cluster-aware and logical-cluster-unaware (== single cluster, standard kube) informers.
func NewScopedDiscoveringDynamicSharedInformerFactory ¶ added in v0.11.0
func NewScopedDiscoveringDynamicSharedInformerFactory( dynamicClient dynamic.Interface, filterFunc func(obj interface{}) bool, tweakListOptions dynamicinformer.TweakListOptionsFunc, gvrSource GVRSource, indexers cache.Indexers, ) (*GenericDiscoveringDynamicSharedInformerFactory[cache.SharedIndexInformer, cache.GenericLister, informers.GenericInformer], error)
NewScopedDiscoveringDynamicSharedInformerFactory returns a factory for cluster-unaware (standard Kube) shared informers that discovers new types and informs on updates to resources of those types. It receives the GVR-related information by delegating to a GVRSource.
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) AddEventHandler ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) AddEventHandler(handler GVREventHandler)
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ForResource ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ForResource(gvr schema.GroupVersionResource) (GenericInformer, error)
ForResource returns the GenericInformer for gvr, creating it if needed. The GenericInformer must be started by calling Start on the GenericDiscoveringDynamicSharedInformerFactory before the GenericInformer can be used.
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Informers ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Informers() (informers map[schema.GroupVersionResource]GenericInformer, notSynced []schema.GroupVersionResource)
Informers returns a map of per-resource-type generic informers 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 (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) RESTMapper ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) RESTMapper() meta.ResettableRESTMapper
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerGroupsAndResources ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredNamespacedResources ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredResources ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerPreferredResources() ([]*metav1.APIResourceList, error)
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerResourcesForGroupVersion ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Start ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) 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 (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) StartWorker ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) StartWorker(ctx context.Context)
StartWorker starts the worker that waits for notifications that informer updates are needed. This call is blocking, stopping when ctx.Done() is closed.
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Subscribe ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Subscribe(id string) <-chan struct{}
Subscribe registers for informer/discovery change notifications, returning a channel to which change notifications are sent.
func (*GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Unsubscribe ¶ added in v0.11.0
func (d *GenericDiscoveringDynamicSharedInformerFactory[Informer, Lister, GenericInformer]) Unsubscribe(id string)
Unsubscribe removes the channel associated with id from future informer/discovery change notifications.