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