builder

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventListenerBuilder

type EventListenerBuilder struct {
	EventListener v1alpha1.EventListener
}

EventListenerBuilder holds the tekton event listener definition

func NewEventListenerBuilder

func NewEventListenerBuilder(name, namespace string) *EventListenerBuilder

NewEventListenerBuilder creates a EventListener with default values.

func (*EventListenerBuilder) ServiceAccount

func (b *EventListenerBuilder) ServiceAccount(name string)

ServiceAccount sets a ServiceAccountName to the EventListener spec.

func (*EventListenerBuilder) TriggerBinding

func (b *EventListenerBuilder) TriggerBinding(templateName string, bindingsName ...string)

TriggerBinding adds a EventListenerTrigger to the EventListener spec.

type MetaOp

type MetaOp interface{}

MetaOp is an interface that is used in other builders. Other builders should have a Meta function that accepts ...MetaOp where ObjectMetaOp/TypeMetaOp are the underlying type.

type ObjectMetaOp

type ObjectMetaOp func(m *metav1.ObjectMeta)

ObjectMetaOp is an operation which modifies the ObjectMeta.

func Annotation

func Annotation(key, value string) ObjectMetaOp

Annotation adds a single annotation to the ObjectMeta.

func Label

func Label(key, value string) ObjectMetaOp

Label adds a single label to the ObjectMeta.

type PipelineBuilder

type PipelineBuilder struct {
	Pipeline v1beta1.Pipeline
}

PipelineBuilder holds the tekton pipeline definition.

func NewPipelineBuilder

func NewPipelineBuilder(name, namespace string) *PipelineBuilder

NewPipelineBuilder creates a Pipeline with default values.

func (*PipelineBuilder) Description

func (b *PipelineBuilder) Description(description string)

Description sets the Description on the Pipeline spec.

func (*PipelineBuilder) Meta

func (b *PipelineBuilder) Meta(ops ...MetaOp)

Meta sets the Meta structs of the Pipeline. Any number of MetaOp modifiers can be passed.

func (*PipelineBuilder) Param

func (b *PipelineBuilder) Param(name string, description string)

Param adds a ParamSpec to the Pipeline spec.

func (*PipelineBuilder) ParamWithDefaultValue

func (b *PipelineBuilder) ParamWithDefaultValue(name, description, defaultValue string)

ParamWithDefaultValue adds a ParamSpec with a default value to the Pipeline spec.

func (*PipelineBuilder) Resource

func (b *PipelineBuilder) Resource(name string, tp string, optional bool)

Resource adds a PipelineDeclaredResource to the Pipeline spec.

func (*PipelineBuilder) Result

func (b *PipelineBuilder) Result(name, description, value string)

Result adds a Result to the Pipeline spec.

func (*PipelineBuilder) Task

func (b *PipelineBuilder) Task(name string, task interface{}, params map[string]string,
	workspaces map[string]string, resources map[string]string)

Task adds a PipelineTask to the Pipeline spec. The PipelineTask can reference an existing task by name (string task paramter), or embeds the task as a TaskSpec (v1beta1.TaskSpec task paramter)

func (*PipelineBuilder) Workspace

func (b *PipelineBuilder) Workspace(name string, optional bool)

Workspace adds a WorkspacePipelineDeclaration to the Pipeline spec.

type PipelineRunBuilder

type PipelineRunBuilder struct {
	PipelineRun v1beta1.PipelineRun
}

PipelineRunBuilder holds the tekton pipeline definition

func NewPipelineRunBuilder

func NewPipelineRunBuilder(generateName string) *PipelineRunBuilder

NewPipelineRunBuilder creates a PipelineRun with default values.

func (*PipelineRunBuilder) GenerateName

func (b *PipelineRunBuilder) GenerateName(generateName string)

GenerateName sets a GenerateName to the PipelineRun meta.

func (*PipelineRunBuilder) Meta

func (b *PipelineRunBuilder) Meta(ops ...MetaOp)

Meta sets the Meta structs of the PipelineRun. Any number of MetaOp modifiers can be passed.

func (*PipelineRunBuilder) Param

func (b *PipelineRunBuilder) Param(name, value string)

Param adds a Param to the PipelineRun spec.

func (*PipelineRunBuilder) PipelineRef

func (b *PipelineRunBuilder) PipelineRef(name string)

PipelineRef sets a PipelineRef to the PipelineRun spec.

func (*PipelineRunBuilder) ResourceGit

func (b *PipelineRunBuilder) ResourceGit(name, url, revision string)

ResourceGit adds a PipelineResourceSpec of type 'git' to the PipelineRun spec.

func (*PipelineRunBuilder) ServiceAccount

func (b *PipelineRunBuilder) ServiceAccount(name string)

ServiceAccount sets a ServiceAccountName to the PipelineRun spec.

func (*PipelineRunBuilder) Workspace

func (b *PipelineRunBuilder) Workspace(name string, accessMode string, size string)

Workspace adds a WorkspaceBinding to the PipelineRun spec.

type TaskSpecBuilder

type TaskSpecBuilder struct {
	TaskSpec v1beta1.TaskSpec
}

TaskSpecBuilder holds the tekton task spec definition.

func NewTaskSpecBuilder

func NewTaskSpecBuilder(name, image, command string) *TaskSpecBuilder

NewTaskSpecBuilder creates a TaskSpec with default values.

func (*TaskSpecBuilder) Env

func (b *TaskSpecBuilder) Env(name, value string)

Env adds a Env to the TaskSpec step.

func (*TaskSpecBuilder) Image

func (b *TaskSpecBuilder) Image(image string)

Image sets the image on the TaskSpec step.

func (*TaskSpecBuilder) Param

func (b *TaskSpecBuilder) Param(name string)

Param adds a ParamSpec to the TaskSpec.

func (*TaskSpecBuilder) ParamWithDescription

func (b *TaskSpecBuilder) ParamWithDescription(name, description string)

ParamWithDescription adds a ParamSpec with a description to the TaskSpec.

func (*TaskSpecBuilder) Resources added in v0.3.0

func (b *TaskSpecBuilder) Resources(requests, limits map[string]string)

Resources add a Resources to the TaskSpec.

func (*TaskSpecBuilder) Result

func (b *TaskSpecBuilder) Result(name string)

Result adds a TaskResult to the TaskSpec.

func (*TaskSpecBuilder) WorkingDir

func (b *TaskSpecBuilder) WorkingDir(workingDir string)

WorkingDir sets the WorkingDir on the TaskSpec step.

func (*TaskSpecBuilder) Workspace

func (b *TaskSpecBuilder) Workspace(name string)

Workspace adds a WorkspaceDeclaration to the TaskSpec.

func (*TaskSpecBuilder) WorkspaceWithMountPath

func (b *TaskSpecBuilder) WorkspaceWithMountPath(name, mountPath string)

WorkspaceWithMountPath adds a WorkspaceDeclaration with a mount path to the TaskSpec.

type TriggerBindingBuilder

type TriggerBindingBuilder struct {
	TriggerBinding v1alpha1.TriggerBinding
}

TriggerBindingBuilder holds the tekton trigger binding definition.

func NewTriggerBindingBuilder

func NewTriggerBindingBuilder(name, namespace string) *TriggerBindingBuilder

NewTriggerBindingBuilder creates a TriggerBinding with default values.

func (*TriggerBindingBuilder) Param

func (b *TriggerBindingBuilder) Param(name, value string)

Param adds a Param to the TriggerBinding spec.

type TriggerTemplateBuilder

type TriggerTemplateBuilder struct {
	TriggerTemplate v1alpha1.TriggerTemplate
}

TriggerTemplateBuilder holds the tekton trigger template definition.

func NewTriggerTemplateBuilder

func NewTriggerTemplateBuilder(name, namespace string) *TriggerTemplateBuilder

NewTriggerTemplateBuilder creates a TriggerTemplate with default values.

func (*TriggerTemplateBuilder) Meta

func (b *TriggerTemplateBuilder) Meta(ops ...MetaOp)

Meta sets the Meta structs of the TriggerTemplate. Any number of MetaOp modifiers can be passed.

func (*TriggerTemplateBuilder) Param

func (b *TriggerTemplateBuilder) Param(name, description string)

Param adds a ParamSpec to the TriggerTemplate spec.

func (*TriggerTemplateBuilder) ParamWithDefaultValue

func (b *TriggerTemplateBuilder) ParamWithDefaultValue(name, description, defaultValue string)

ParamWithDefaultValue adds a ParamSpec with a default value to the TriggerTemplate spec.

func (*TriggerTemplateBuilder) ResourceTemplate

func (b *TriggerTemplateBuilder) ResourceTemplate(resoureceTemplate runtime.RawExtension)

ResourceTemplate adds a ResourceTemplate to the TriggerTemplate spec.

type TypeMetaOp

type TypeMetaOp func(m *metav1.TypeMeta)

TypeMetaOp is an operation which modifies the TypeMeta.

func TypeMeta

func TypeMeta(kind, apiVersion string) TypeMetaOp

TypeMeta sets the TypeMeta struct with default values.

Jump to

Keyboard shortcuts

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