karmada/pkg/generated/informers/externalversions/config/v1alpha1/resourceinterpretercustomiz...

74 lines
3.4 KiB
Go

// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
configv1alpha1 "github.com/karmada-io/karmada/pkg/apis/config/v1alpha1"
versioned "github.com/karmada-io/karmada/pkg/generated/clientset/versioned"
internalinterfaces "github.com/karmada-io/karmada/pkg/generated/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/karmada-io/karmada/pkg/generated/listers/config/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// ResourceInterpreterCustomizationInformer provides access to a shared informer and lister for
// ResourceInterpreterCustomizations.
type ResourceInterpreterCustomizationInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ResourceInterpreterCustomizationLister
}
type resourceInterpreterCustomizationInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewResourceInterpreterCustomizationInformer constructs a new informer for ResourceInterpreterCustomization type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewResourceInterpreterCustomizationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredResourceInterpreterCustomizationInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredResourceInterpreterCustomizationInformer constructs a new informer for ResourceInterpreterCustomization type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredResourceInterpreterCustomizationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ConfigV1alpha1().ResourceInterpreterCustomizations().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ConfigV1alpha1().ResourceInterpreterCustomizations().Watch(context.TODO(), options)
},
},
&configv1alpha1.ResourceInterpreterCustomization{},
resyncPeriod,
indexers,
)
}
func (f *resourceInterpreterCustomizationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredResourceInterpreterCustomizationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *resourceInterpreterCustomizationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&configv1alpha1.ResourceInterpreterCustomization{}, f.defaultInformer)
}
func (f *resourceInterpreterCustomizationInformer) Lister() v1alpha1.ResourceInterpreterCustomizationLister {
return v1alpha1.NewResourceInterpreterCustomizationLister(f.Informer().GetIndexer())
}