forked from openshift/origin
/
oauthclientauthorization.go
57 lines (49 loc) · 2.45 KB
/
oauthclientauthorization.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
53
54
55
56
57
// This file was automatically generated by informer-gen
package internalversion
import (
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth"
internalinterfaces "github.com/openshift/origin/pkg/oauth/generated/informers/internalversion/internalinterfaces"
internalclientset "github.com/openshift/origin/pkg/oauth/generated/internalclientset"
internalversion "github.com/openshift/origin/pkg/oauth/generated/listers/oauth/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"
)
// OAuthClientAuthorizationInformer provides access to a shared informer and lister for
// OAuthClientAuthorizations.
type OAuthClientAuthorizationInformer interface {
Informer() cache.SharedIndexInformer
Lister() internalversion.OAuthClientAuthorizationLister
}
type oAuthClientAuthorizationInformer struct {
factory internalinterfaces.SharedInformerFactory
}
// NewOAuthClientAuthorizationInformer constructs a new informer for OAuthClientAuthorization type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewOAuthClientAuthorizationInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.Oauth().OAuthClientAuthorizations().List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.Oauth().OAuthClientAuthorizations().Watch(options)
},
},
&oauth.OAuthClientAuthorization{},
resyncPeriod,
indexers,
)
}
func defaultOAuthClientAuthorizationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewOAuthClientAuthorizationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *oAuthClientAuthorizationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&oauth.OAuthClientAuthorization{}, defaultOAuthClientAuthorizationInformer)
}
func (f *oAuthClientAuthorizationInformer) Lister() internalversion.OAuthClientAuthorizationLister {
return internalversion.NewOAuthClientAuthorizationLister(f.Informer().GetIndexer())
}