Fix golint errors when generating informer code

This commit is contained in:
Miguel Bernabeu 2018-10-03 21:39:26 +02:00
parent f9acfd8e38
commit acf78cd613
16 changed files with 32 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import (
internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
) )
// NewInformerFunc takes internalclientset.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
) )
// NewInformerFunc takes clientset.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
) )
// NewInformerFunc takes internalclientset.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
) )
// NewInformerFunc takes kubernetes.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(kubernetes.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(kubernetes.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
) )
// NewInformerFunc takes internalversion.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" versioned "k8s.io/code-generator/_examples/crd/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -76,6 +76,7 @@ func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types.
} }
var externalSharedInformerFactoryInterface = ` var externalSharedInformerFactoryInterface = `
// NewInformerFunc takes {{.clientSetPackage|raw}} and {{.timeDuration|raw}} to return a SharedIndexInformer.
type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -84,5 +85,6 @@ type SharedInformerFactory interface {
InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}} InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}}
} }
// TweakListOptionsFunc is a function that transforms a {{.v1ListOptions|raw}}.
type TweakListOptionsFunc func(*{{.v1ListOptions|raw}}) type TweakListOptionsFunc func(*{{.v1ListOptions|raw}})
` `

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/csi-api/pkg/client/clientset/versioned" versioned "k8s.io/csi-api/pkg/client/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
clientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" clientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
) )
// NewInformerFunc takes clientset.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
internalclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset" internalclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset"
) )
// NewInformerFunc takes internalclientset.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/sample-apiserver/pkg/client/clientset/versioned" versioned "k8s.io/sample-apiserver/pkg/client/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
internalversion "k8s.io/sample-apiserver/pkg/client/clientset/internalversion" internalversion "k8s.io/sample-apiserver/pkg/client/clientset/internalversion"
) )
// NewInformerFunc takes internalversion.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -27,6 +27,7 @@ import (
versioned "k8s.io/sample-controller/pkg/client/clientset/versioned" versioned "k8s.io/sample-controller/pkg/client/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle // SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
} }
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions) type TweakListOptionsFunc func(*v1.ListOptions)