1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright (c) 2020 Intel Corporation
3 // Code generated by informer-gen. DO NOT EDIT.
8 k8spluginv1alpha1 "github.com/open-ness/EMCO/src/monitor/pkg/apis/k8splugin/v1alpha1"
9 versioned "github.com/open-ness/EMCO/src/monitor/pkg/generated/clientset/versioned"
10 internalinterfaces "github.com/open-ness/EMCO/src/monitor/pkg/generated/informers/externalversions/internalinterfaces"
11 v1alpha1 "github.com/open-ness/EMCO/src/monitor/pkg/generated/listers/k8splugin/v1alpha1"
14 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
15 runtime "k8s.io/apimachinery/pkg/runtime"
16 watch "k8s.io/apimachinery/pkg/watch"
17 cache "k8s.io/client-go/tools/cache"
20 // ResourceBundleStateInformer provides access to a shared informer and lister for
21 // ResourceBundleStates.
22 type ResourceBundleStateInformer interface {
23 Informer() cache.SharedIndexInformer
24 Lister() v1alpha1.ResourceBundleStateLister
27 type resourceBundleStateInformer struct {
28 factory internalinterfaces.SharedInformerFactory
29 tweakListOptions internalinterfaces.TweakListOptionsFunc
33 // NewResourceBundleStateInformer constructs a new informer for ResourceBundleState type.
34 // Always prefer using an informer factory to get a shared informer instead of getting an independent
35 // one. This reduces memory footprint and number of connections to the server.
36 func NewResourceBundleStateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
37 return NewFilteredResourceBundleStateInformer(client, namespace, resyncPeriod, indexers, nil)
40 // NewFilteredResourceBundleStateInformer constructs a new informer for ResourceBundleState type.
41 // Always prefer using an informer factory to get a shared informer instead of getting an independent
42 // one. This reduces memory footprint and number of connections to the server.
43 func NewFilteredResourceBundleStateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
44 return cache.NewSharedIndexInformer(
46 ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
47 if tweakListOptions != nil {
48 tweakListOptions(&options)
50 return client.K8spluginV1alpha1().ResourceBundleStates(namespace).List(options)
52 WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
53 if tweakListOptions != nil {
54 tweakListOptions(&options)
56 return client.K8spluginV1alpha1().ResourceBundleStates(namespace).Watch(options)
59 &k8spluginv1alpha1.ResourceBundleState{},
65 func (f *resourceBundleStateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
66 return NewFilteredResourceBundleStateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
69 func (f *resourceBundleStateInformer) Informer() cache.SharedIndexInformer {
70 return f.factory.InformerFor(&k8spluginv1alpha1.ResourceBundleState{}, f.defaultInformer)
73 func (f *resourceBundleStateInformer) Lister() v1alpha1.ResourceBundleStateLister {
74 return v1alpha1.NewResourceBundleStateLister(f.Informer().GetIndexer())