cronjob

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Options *typed.HandlerOptions

	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, namespace, kubeconfig string) (handler *Handler, err error)

New returns a cronjob handler from kubeconfig or in-cluster config.

func (*Handler) Apply

func (h *Handler) Apply(name string) (*batchv1.CronJob, error)

Apply apply cronjob from file, alias to "ApplyFromFile".

func (*Handler) ApplyFromBytes

func (h *Handler) ApplyFromBytes(data []byte) (cronjob *batchv1.CronJob, err error)

ApplyFromBytes apply cronjob from bytes.

func (*Handler) ApplyFromFile

func (h *Handler) ApplyFromFile(filename string) (cronjob *batchv1.CronJob, err error)

ApplyFromFile apply cronjob from yaml file

func (*Handler) ApplyFromRaw

func (h *Handler) ApplyFromRaw(raw map[string]interface{}) (*batchv1.CronJob, error)

ApplyFromRaw apply cronjob from map[string]interface{}.

func (*Handler) Create

func (h *Handler) Create(path string) (*batchv1.CronJob, error)

Create create cronjob from file, alias to "CreateFromFile".

func (*Handler) CreateFromBytes

func (h *Handler) CreateFromBytes(data []byte) (*batchv1.CronJob, error)

CreateFromBytes create cronjob from bytes.

func (*Handler) CreateFromFile

func (h *Handler) CreateFromFile(filename string) (*batchv1.CronJob, error)

CreateFromFile create cronjob from yaml file.

func (*Handler) CreateFromRaw

func (h *Handler) CreateFromRaw(raw map[string]interface{}) (*batchv1.CronJob, error)

CreateFromRaw create cronjob from map[string]interface{}.

func (*Handler) DeepCopy

func (in *Handler) DeepCopy() *Handler

func (*Handler) Delete

func (h *Handler) Delete(name string) (err error)

Delete delete cronjob by name, alias to "DeleteByName".

func (*Handler) DeleteByName

func (h *Handler) DeleteByName(name string) error

DeleteByName delete cronjob by name.

func (*Handler) DeleteFromBytes

func (h *Handler) DeleteFromBytes(data []byte) (err error)

DeleteFromBytes delete cronjob from bytes.

func (*Handler) DeleteFromFile

func (h *Handler) DeleteFromFile(filename string) error

DeleteFromFile delete cronjob from yaml file.

func (*Handler) Get

func (h *Handler) Get(name string) (*batchv1.CronJob, error)

Get get cronjob by name.

func (*Handler) GetFromBytes

func (h *Handler) GetFromBytes(data []byte) (*batchv1.CronJob, error)

GetFromBytes get cronjob from bytes.

func (*Handler) GetFromFile

func (h *Handler) GetFromFile(filename string) (*batchv1.CronJob, error)

GetFromFile get cronjob from yaml file.

func (*Handler) GetJobs

func (h *Handler) GetJobs(name string) ([]batchv1.Job, error)

GetJobs get all jobs which generated by the cronjob.

func (*Handler) List

func (h *Handler) List(labels string) (*batchv1.CronJobList, error)

List list cronjobs by labels, alias to ListByLabel.

func (*Handler) ListAll

func (h *Handler) ListAll(namespace string) (*batchv1.CronJobList, error)

ListAll list all cronjobs in the k8s cluster.

func (*Handler) ListByLabel

func (h *Handler) ListByLabel(labels string) (*batchv1.CronJobList, error)

ListByLabel list cronjobs by labels.

func (*Handler) ListByNamespace

func (h *Handler) ListByNamespace(namespace string) (*batchv1.CronJobList, error)

ListByNamespace list cronjobs by namespace.

func (*Handler) Namespace

func (h *Handler) Namespace() string

func (*Handler) RunInformer

func (h *Handler) RunInformer(
	addFunc func(obj interface{}),
	updateFunc func(oldObj, newObj interface{}),
	deleteFunc func(obj interface{}),
	stopCh chan struct{})

RunInformer.

func (*Handler) SetForceDelete

func (h *Handler) SetForceDelete(force bool)

func (*Handler) SetLimit

func (h *Handler) SetLimit(limit int64)

func (*Handler) SetPropagationPolicy

func (h *Handler) SetPropagationPolicy(policy string)

Whether and how garbage collection will be performed. support value are "Background", "Orphan", "Foreground", default value is "Background"

func (*Handler) SetTimeout

func (h *Handler) SetTimeout(timeout int64)

func (*Handler) Update

func (h *Handler) Update(path string) (*batchv1.CronJob, error)

Update update cronjob from file, alias to "UpdateFromFile".

func (*Handler) UpdateFromBytes

func (h *Handler) UpdateFromBytes(data []byte) (*batchv1.CronJob, error)

UpdateFromBytes update cronjob from bytes.

func (*Handler) UpdateFromFile

func (h *Handler) UpdateFromFile(path string) (*batchv1.CronJob, error)

UpdateFromFile update cronjob from yaml file.

func (*Handler) UpdateFromRaw

func (h *Handler) UpdateFromRaw(raw map[string]interface{}) (*batchv1.CronJob, error)

UpdateFromRaw update cronjob from map[string]interface{}.

func (*Handler) Watch

func (h *Handler) Watch(name string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

Watch watch cronjobs by name, alias to "WatchByName".

func (*Handler) WatchByLabel

func (h *Handler) WatchByLabel(labelSelector string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

WatchByLabel watch cronjobs by label.

func (*Handler) WatchByName

func (h *Handler) WatchByName(name string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

WatchByName watch cronjobs by name.

func (*Handler) WithDryRun

func (h *Handler) WithDryRun() *Handler

func (*Handler) WithNamespace

func (h *Handler) WithNamespace(namespace string) *Handler

Jump to

Keyboard shortcuts

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