v1

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupName = "batch"
	Version   = "v1"
)

Variables

View Source
var (
	JobGroupVersionKind = schema.GroupVersionKind{
		Version: Version,
		Group:   GroupName,
		Kind:    "Job",
	}
	JobResource = metav1.APIResource{
		Name:         "jobs",
		SingularName: "job",
		Namespaced:   true,

		Kind: JobGroupVersionKind.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) Jobs

func (c *Client) Jobs(namespace string) JobInterface

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 Clients

type Clients struct {
	Job JobClient
}

func ClientsFrom

func ClientsFrom(ctx context.Context) *Clients

func NewClients

func NewClients(config rest.Config) (*Clients, error)

func NewClientsFromInterface

func NewClientsFromInterface(iface Interface) *Clients

type Interface

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

	JobsGetter
}

func From

func From(ctx context.Context) Interface

func NewForConfig

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

type JobChangeHandlerFunc

type JobChangeHandlerFunc func(obj *v1.Job) (runtime.Object, error)

type JobClient

type JobClient interface {
	Create(*v1.Job) (*v1.Job, error)
	Get(namespace, name string, opts metav1.GetOptions) (*v1.Job, error)
	Update(*v1.Job) (*v1.Job, error)
	Delete(namespace, name string, options *metav1.DeleteOptions) error
	List(namespace string, opts metav1.ListOptions) (*JobList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)

	Cache() JobClientCache

	OnCreate(ctx context.Context, name string, sync JobChangeHandlerFunc)
	OnChange(ctx context.Context, name string, sync JobChangeHandlerFunc)
	OnRemove(ctx context.Context, name string, sync JobChangeHandlerFunc)
	Enqueue(namespace, name string)

	Generic() controller.GenericController
	Interface() JobInterface
}

type JobClientCache

type JobClientCache interface {
	Get(namespace, name string) (*v1.Job, error)
	List(namespace string, selector labels.Selector) ([]*v1.Job, error)

	Index(name string, indexer JobIndexer)
	GetIndexed(name, key string) ([]*v1.Job, error)
}

type JobController

type JobController interface {
	Generic() controller.GenericController
	Informer() cache.SharedIndexInformer
	Lister() JobLister
	AddHandler(ctx context.Context, name string, handler JobHandlerFunc)
	AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler JobHandlerFunc)
	Enqueue(namespace, name string)
	Sync(ctx context.Context) error
	Start(ctx context.Context, threadiness int) error
}

type JobHandlerFunc

type JobHandlerFunc func(key string, obj *v1.Job) (runtime.Object, error)

func NewJobLifecycleAdapter

func NewJobLifecycleAdapter(name string, clusterScoped bool, client JobInterface, l JobLifecycle) JobHandlerFunc

type JobIndexer

type JobIndexer func(obj *v1.Job) ([]string, error)

type JobInterface

type JobInterface interface {
	ObjectClient() *objectclient.ObjectClient
	Create(*v1.Job) (*v1.Job, error)
	GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.Job, error)
	Get(name string, opts metav1.GetOptions) (*v1.Job, error)
	Update(*v1.Job) (*v1.Job, error)
	Delete(name string, options *metav1.DeleteOptions) error
	DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
	List(opts metav1.ListOptions) (*JobList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
	Controller() JobController
	AddHandler(ctx context.Context, name string, sync JobHandlerFunc)
	AddLifecycle(ctx context.Context, name string, lifecycle JobLifecycle)
	AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync JobHandlerFunc)
	AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle JobLifecycle)
}

type JobLifecycle

type JobLifecycle interface {
	Create(obj *v1.Job) (runtime.Object, error)
	Remove(obj *v1.Job) (runtime.Object, error)
	Updated(obj *v1.Job) (runtime.Object, error)
}

type JobList

type JobList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []v1.Job
}

func (*JobList) DeepCopy

func (in *JobList) DeepCopy() *JobList

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

func (*JobList) DeepCopyInto

func (in *JobList) DeepCopyInto(out *JobList)

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

func (*JobList) DeepCopyObject

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

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

type JobLister

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

type JobsGetter

type JobsGetter interface {
	Jobs(namespace string) JobInterface
}

Jump to

Keyboard shortcuts

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