builders

package
v0.0.0-...-a0b04c9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronJob

type CronJob struct {
	Name        string
	Namespace   string
	Labels      map[string]string
	Annotations map[string]string
	Schedule    string
	JobTemplate batchv1.JobTemplateSpec
	CronJob     *batchv1.CronJob
}

CronJob struct for build a cronJob

func NewCronJobBuilder

func NewCronJobBuilder(name string) *CronJob

NewCronJobBuilder return a cronJob builder

func (*CronJob) Build

func (c *CronJob) Build() *batchv1.CronJob

Build build a cronJob

func (*CronJob) SetAnnotations

func (c *CronJob) SetAnnotations(annotation map[string]string) *CronJob

SetAnnotations sets cronJob annotations

func (*CronJob) SetJobTemplate

func (c *CronJob) SetJobTemplate(cronJobTemplate batchv1.JobTemplateSpec) *CronJob

SetJobTemplate set pod template for deployment

func (*CronJob) SetLabels

func (c *CronJob) SetLabels(labels map[string]string) *CronJob

SetLabels set cronJob labels

func (*CronJob) SetNamespace

func (c *CronJob) SetNamespace(namespace string) *CronJob

SetNamespace set cronJob namespace

func (*CronJob) SetSchedule

func (c *CronJob) SetSchedule(schedule string) *CronJob

SetSchedule set job schedule

func (*CronJob) ToYaml

func (c *CronJob) ToYaml() []byte

ToYaml convert deployment struct to kubernetes yaml

type Job

type Job struct {
	Name                    string
	Namespace               string
	Labels                  map[string]string
	Annotations             map[string]string
	MatchLabels             map[string]string
	PodTemplate             corev1.PodTemplateSpec
	BackOffLimit            *int32
	TTLSecondsAfterFinished *int32
	Job                     *batchv1.Job
	JobTemplate             *batchv1.JobTemplateSpec
}

Job struct for build a job

func NewJobBuilder

func NewJobBuilder(name string) *Job

NewJobBuilder return a job builder

func (*Job) Build

func (j *Job) Build() *batchv1.Job

Build build a job

func (*Job) BuildTemplate

func (j *Job) BuildTemplate() *batchv1.JobTemplateSpec

BuildTemplate build a job

func (*Job) SetAnnotations

func (j *Job) SetAnnotations(annotation map[string]string) *Job

SetAnnotations sets job annotations

func (*Job) SetBackOffLimit

func (j *Job) SetBackOffLimit(backOffLimit int32) *Job

SetBackOffLimit set backoff limits in the job

func (*Job) SetLabels

func (j *Job) SetLabels(labels map[string]string) *Job

SetLabels set job labels

func (*Job) SetMatchLabels

func (j *Job) SetMatchLabels(matchLabels map[string]string) *Job

SetMatchLabels sets job match labels

func (*Job) SetNamespace

func (j *Job) SetNamespace(namespace string) *Job

SetNamespace set job namespace

func (*Job) SetPodTemplate

func (j *Job) SetPodTemplate(podTemplate corev1.PodTemplateSpec) *Job

SetPodTemplate set pod template for deployment

func (*Job) SetTTLSecondsAfterFinished

func (j *Job) SetTTLSecondsAfterFinished(ttlSecondsAfterFinished int32) *Job

SetTTLSecondsAfterFinished set ttl seconds after finished Job

func (*Job) ToYaml

func (j *Job) ToYaml() []byte

ToYaml convert deployment struct to kubernetes yaml

Jump to

Keyboard shortcuts

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