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