Documentation
¶
Index ¶
- Constants
- Variables
- func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error)
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type Client
- type Foo
- type FooController
- type FooHandlerFunc
- type FooInterface
- type FooLifecycle
- type FooList
- type FooLister
- type FooSpec
- type FoosGetter
- type Interface
Constants ¶
const ( GroupName = "some.api.group" Version = "v1" )
Variables ¶
var ( APIVersion = types.APIVersion{ Group: "some.api.group", Version: "v1", Path: "/v1-someapi", } Schemas = factory. Schemas(&APIVersion). MustImport(&APIVersion, Foo{}) )
var ( FooGroupVersionKind = schema.GroupVersionKind{ Version: Version, Group: GroupName, Kind: "Foo", } FooResource = metav1.APIResource{ Name: "foos", SingularName: "foo", Namespaced: true, Kind: FooGroupVersionKind.Kind, } )
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type Client ¶
func (*Client) Foos ¶
func (c *Client) Foos(namespace string) FooInterface
func (*Client) RESTClient ¶
type Foo ¶
type Foo struct { types.Namespaced metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec FooSpec `json:"spec"` }
func (*Foo) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Foo.
func (*Foo) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Foo) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FooController ¶
type FooController interface { Generic() controller.GenericController Informer() cache.SharedIndexInformer Lister() FooLister AddHandler(ctx context.Context, name string, handler FooHandlerFunc) AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler FooHandlerFunc) Enqueue(namespace, name string) Sync(ctx context.Context) error Start(ctx context.Context, threadiness int) error }
type FooHandlerFunc ¶
func NewFooLifecycleAdapter ¶
func NewFooLifecycleAdapter(name string, clusterScoped bool, client FooInterface, l FooLifecycle) FooHandlerFunc
type FooInterface ¶
type FooInterface interface { ObjectClient() *objectclient.ObjectClient Create(*Foo) (*Foo, error) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Foo, error) Get(name string, opts metav1.GetOptions) (*Foo, error) Update(*Foo) (*Foo, error) Delete(name string, options *metav1.DeleteOptions) error DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error List(opts metav1.ListOptions) (*FooList, error) Watch(opts metav1.ListOptions) (watch.Interface, error) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error Controller() FooController AddHandler(ctx context.Context, name string, sync FooHandlerFunc) AddLifecycle(ctx context.Context, name string, lifecycle FooLifecycle) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync FooHandlerFunc) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle FooLifecycle) }
type FooLifecycle ¶
type FooList ¶
type FooList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Foo }
func (*FooList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooList.
func (*FooList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FooList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FooSpec ¶
type FooSpec struct {
Option bool `json:"option"`
}
func (*FooSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooSpec.
func (*FooSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FoosGetter ¶
type FoosGetter interface {
Foos(namespace string) FooInterface
}