/
clusterpolicybinding.go
52 lines (44 loc) · 2.01 KB
/
clusterpolicybinding.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This file was automatically generated by informer-gen
package internalversion
import (
authorization "github.com/openshift/origin/pkg/authorization/apis/authorization"
internalinterfaces "github.com/openshift/origin/pkg/authorization/generated/informers/internalversion/internalinterfaces"
internalclientset "github.com/openshift/origin/pkg/authorization/generated/internalclientset"
internalversion "github.com/openshift/origin/pkg/authorization/generated/listers/authorization/internalversion"
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"
time "time"
)
// ClusterPolicyBindingInformer provides access to a shared informer and lister for
// ClusterPolicyBindings.
type ClusterPolicyBindingInformer interface {
Informer() cache.SharedIndexInformer
Lister() internalversion.ClusterPolicyBindingLister
}
type clusterPolicyBindingInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newClusterPolicyBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
sharedIndexInformer := cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.Authorization().ClusterPolicyBindings().List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.Authorization().ClusterPolicyBindings().Watch(options)
},
},
&authorization.ClusterPolicyBinding{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
)
return sharedIndexInformer
}
func (f *clusterPolicyBindingInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&authorization.ClusterPolicyBinding{}, newClusterPolicyBindingInformer)
}
func (f *clusterPolicyBindingInformer) Lister() internalversion.ClusterPolicyBindingLister {
return internalversion.NewClusterPolicyBindingLister(f.Informer().GetIndexer())
}