v1

package
v0.0.0-...-59fcf8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupName = "some.api.group"
	Version   = "v1"
)

Variables

View Source
var (
	APIVersion = types.APIVersion{
		Group:   "some.api.group",
		Version: "v1",
		Path:    "/v1-someapi",
	}
	Schemas = factory.
			Schemas(&APIVersion).
			MustImport(&APIVersion, Foo{})
)
View Source
var (
	FooGroupVersionKind = schema.GroupVersionKind{
		Version: Version,
		Group:   GroupName,
		Kind:    "Foo",
	}
	FooResource = metav1.APIResource{
		Name:         "foos",
		SingularName: "foo",
		Namespaced:   true,

		Kind: FooGroupVersionKind.Kind,
	}
)
View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}

SchemeGroupVersion is group version used to register these objects

Functions

func Factory

func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error)

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Client) Foos

func (c *Client) Foos(namespace string) FooInterface

func (*Client) RESTClient

func (c *Client) RESTClient() rest.Interface

func (*Client) Start

func (c *Client) Start(ctx context.Context, threadiness int) error

func (*Client) Sync

func (c *Client) Sync(ctx context.Context) error

type Foo

type Foo struct {
	types.Namespaced

	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec FooSpec `json:"spec"`
}

func (*Foo) DeepCopy

func (in *Foo) DeepCopy() *Foo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Foo.

func (*Foo) DeepCopyInto

func (in *Foo) DeepCopyInto(out *Foo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Foo) DeepCopyObject

func (in *Foo) DeepCopyObject() runtime.Object

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

type FooHandlerFunc func(key string, obj *Foo) (runtime.Object, error)

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 FooLifecycle interface {
	Create(obj *Foo) (runtime.Object, error)
	Remove(obj *Foo) (runtime.Object, error)
	Updated(obj *Foo) (runtime.Object, error)
}

type FooList

type FooList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Foo
}

func (*FooList) DeepCopy

func (in *FooList) DeepCopy() *FooList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooList.

func (*FooList) DeepCopyInto

func (in *FooList) DeepCopyInto(out *FooList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FooList) DeepCopyObject

func (in *FooList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FooLister

type FooLister interface {
	List(namespace string, selector labels.Selector) (ret []*Foo, err error)
	Get(namespace, name string) (*Foo, error)
}

type FooSpec

type FooSpec struct {
	Option bool `json:"option"`
}

func (*FooSpec) DeepCopy

func (in *FooSpec) DeepCopy() *FooSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FooSpec.

func (*FooSpec) DeepCopyInto

func (in *FooSpec) DeepCopyInto(out *FooSpec)

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
}

type Interface

type Interface interface {
	RESTClient() rest.Interface
	controller.Starter

	FoosGetter
}

func From

func From(ctx context.Context) Interface

func NewForConfig

func NewForConfig(config rest.Config) (Interface, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL