4f9fe92b40a6266bf2e3aa7651c8a79b0e3148d6
[icn/sdwan.git] /
1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright (c) 2020 Intel Corporation
3 // Code generated by informer-gen. DO NOT EDIT.
4
5 package v1alpha1
6
7 import (
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"
12         time "time"
13
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"
18 )
19
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
25 }
26
27 type resourceBundleStateInformer struct {
28         factory          internalinterfaces.SharedInformerFactory
29         tweakListOptions internalinterfaces.TweakListOptionsFunc
30         namespace        string
31 }
32
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)
38 }
39
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(
45                 &cache.ListWatch{
46                         ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
47                                 if tweakListOptions != nil {
48                                         tweakListOptions(&options)
49                                 }
50                                 return client.K8spluginV1alpha1().ResourceBundleStates(namespace).List(options)
51                         },
52                         WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
53                                 if tweakListOptions != nil {
54                                         tweakListOptions(&options)
55                                 }
56                                 return client.K8spluginV1alpha1().ResourceBundleStates(namespace).Watch(options)
57                         },
58                 },
59                 &k8spluginv1alpha1.ResourceBundleState{},
60                 resyncPeriod,
61                 indexers,
62         )
63 }
64
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)
67 }
68
69 func (f *resourceBundleStateInformer) Informer() cache.SharedIndexInformer {
70         return f.factory.InformerFor(&k8spluginv1alpha1.ResourceBundleState{}, f.defaultInformer)
71 }
72
73 func (f *resourceBundleStateInformer) Lister() v1alpha1.ResourceBundleStateLister {
74         return v1alpha1.NewResourceBundleStateLister(f.Informer().GetIndexer())
75 }