processor

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAllowFailure = errors.New("ignore error returned from step")
View Source
var ErrConditionFalse = errors.New("conditional step skipped")
View Source
var ErrSkipBlacklist = errors.New("skip blacklisted step")
View Source
var ErrSkipDone = errors.New("skip step marked as successful")

Functions

func AbortOnError

func AbortOnError(err error) bool

func InterfaceToAny added in v0.0.7

func InterfaceToAny(i interface{}) (*anypb.Any, error)

Convert interface{} to *anypb.Any (packing)

func PrefixName

func PrefixName(name, prefix string) string

Types

type AllowFailure

type AllowFailure struct {
}

func (*AllowFailure) Bootstrap

func (s *AllowFailure) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type And

type And struct {
	// contains filtered or unexported fields
}

func (*And) Bootstrap

func (s *And) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Bootstraper

type Bootstraper interface {
	Bootstrap(pipeline Pipeline, next Next) (Next, error)
}

func Builder

func Builder(spec *v1beta1.Step, builders ...ProcessorBuilder) []Bootstraper

type Concurrent

type Concurrent struct {
	// contains filtered or unexported fields
}

func (*Concurrent) Bootstrap

func (s *Concurrent) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Env added in v0.0.7

type Env struct {
	// contains filtered or unexported fields
}

func (*Env) Bootstrap added in v0.0.7

func (s *Env) Bootstrap(pipeline Pipeline, next Next) (Next, error)

func (*Env) MarshalJSON added in v0.0.7

func (s *Env) MarshalJSON() ([]byte, error)

func (*Env) UnmarshalJSON added in v0.0.7

func (s *Env) UnmarshalJSON(b []byte) error

type Executable

type Executable func(ctx context.Context) (StepContext, error)

type ExpressionParser

type ExpressionParser struct {
	// contains filtered or unexported fields
}

func (*ExpressionParser) Bootstrap

func (s *ExpressionParser) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type GarbageCollector

type GarbageCollector struct {
	// contains filtered or unexported fields
}

func (*GarbageCollector) Bootstrap

func (s *GarbageCollector) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type If

type If struct {
	// contains filtered or unexported fields
}

func (*If) Bootstrap

func (s *If) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Inherit

type Inherit struct {
	// contains filtered or unexported fields
}

func (*Inherit) Bootstrap

func (s *Inherit) Bootstrap(pipeline Pipeline, next Next) (Next, error)

func (*Inherit) MarshalJSON

func (s *Inherit) MarshalJSON() ([]byte, error)

func (*Inherit) UnmarshalJSON

func (s *Inherit) UnmarshalJSON(b []byte) error

type Matrix

type Matrix struct {
	// contains filtered or unexported fields
}

func (*Matrix) Bootstrap

func (s *Matrix) Bootstrap(pipeline Pipeline, next Next) (Next, error)

func (*Matrix) MarshalJSON

func (s *Matrix) MarshalJSON() ([]byte, error)

func (*Matrix) UnmarshalJSON

func (s *Matrix) UnmarshalJSON(b []byte) error

type Needs

type Needs struct {
	// contains filtered or unexported fields
}

func (*Needs) Bootstrap

func (s *Needs) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Next

type Next func(ctx context.Context, stepContext StepContext) (StepContext, error)

func Chain

func Chain(pipeline Pipeline, s ...Bootstraper) (Next, error)

type OtelMetrics added in v0.0.7

type OtelMetrics struct {
	// contains filtered or unexported fields
}

func (*OtelMetrics) Bootstrap added in v0.0.7

func (s *OtelMetrics) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type OtelTrace added in v0.0.7

type OtelTrace struct {
	// contains filtered or unexported fields
}

func (*OtelTrace) Bootstrap added in v0.0.7

func (s *OtelTrace) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type OutputCloser

type OutputCloser func(err error)

type OutputFactory

type OutputFactory func(name string, stdin io.Reader, stdout, stderr io.Writer) (io.Reader, io.Writer, io.Writer, OutputCloser)

type Pipe

type Pipe struct {
	// contains filtered or unexported fields
}

func (*Pipe) Bootstrap

func (s *Pipe) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Pipeline

type Pipeline interface {
	Step(name string) (Step, error)
	Entrypoint(name string) (Next, error)
	Name() string
	ID() string
}

type PipelineBuilder

type PipelineBuilder interface {
	Build(pipeline v1beta1.Pipeline, entrypoint string, inputs map[string]string) (Executable, error)
}

type ProcessorBuilder

type ProcessorBuilder func(spec *v1beta1.Step) Bootstraper

func WithAllowFailure

func WithAllowFailure() ProcessorBuilder

func WithAnd

func WithAnd() ProcessorBuilder

func WithConcurrent

func WithConcurrent() ProcessorBuilder

func WithEnv added in v0.0.7

func WithEnv(defaultEnv map[string]string) ProcessorBuilder

func WithExpressionParser

func WithExpressionParser(celEnv *cel.Env, processors ...Bootstraper) ProcessorBuilder

func WithGarbageCollector

func WithGarbageCollector(noGC bool, driver runtime.Interface, teardown chan Teardown) ProcessorBuilder

func WithIf

func WithIf(celEnv *cel.Env) ProcessorBuilder

func WithInherit

func WithInherit(builder PipelineBuilder, store storage.Interface) ProcessorBuilder

func WithMatrix

func WithMatrix() ProcessorBuilder

func WithNeeds

func WithNeeds() ProcessorBuilder

func WithOtelMetrics added in v0.0.7

func WithOtelMetrics(meter metric.Meter) ProcessorBuilder

func WithOtelTrace added in v0.0.7

func WithOtelTrace(logger logr.Logger, tracer trace.Tracer) ProcessorBuilder

func WithPipe

func WithPipe() ProcessorBuilder

func WithReport

func WithReport(store ResultStore, uniqueName string) ProcessorBuilder

func WithResult added in v0.0.7

func WithResult() ProcessorBuilder

func WithRetry

func WithRetry() ProcessorBuilder

func WithRun

func WithRun(tee bool, defaultPullPolicy runtime.PullImagePolicy, driver runtime.Interface, outputFactory OutputFactory, stdin io.Reader, stdout, stderr io.Writer) ProcessorBuilder

func WithSkipBlacklist added in v0.0.7

func WithSkipBlacklist(blacklist []string) ProcessorBuilder

func WithSkipDone

func WithSkipDone(skipDone bool) ProcessorBuilder

func WithStdio

func WithStdio() ProcessorBuilder

func WithTimeout

func WithTimeout() ProcessorBuilder

func WithTmpDir added in v0.0.9

func WithTmpDir() ProcessorBuilder

type Report

type Report struct {
	// contains filtered or unexported fields
}

func (*Report) Bootstrap

func (s *Report) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Result added in v0.0.7

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) Bootstrap added in v0.0.7

func (s *Result) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type ResultStore

type ResultStore interface {
	Add(stepName string, result *StepResult)
}

type Retry

type Retry struct {
	// contains filtered or unexported fields
}

func (*Retry) Bootstrap

func (s *Retry) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Run

type Run struct {
	// contains filtered or unexported fields
}

func (*Run) Bootstrap

func (s *Run) Bootstrap(pipeline Pipeline, next Next) (Next, error)

func (*Run) MarshalJSON

func (s *Run) MarshalJSON() ([]byte, error)

func (*Run) UnmarshalJSON

func (s *Run) UnmarshalJSON(b []byte) error

type SkipBlacklist added in v0.0.7

type SkipBlacklist struct {
	// contains filtered or unexported fields
}

func (*SkipBlacklist) Bootstrap added in v0.0.7

func (s *SkipBlacklist) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type SkipDone

type SkipDone struct {
	// contains filtered or unexported fields
}

func (*SkipDone) Bootstrap

func (s *SkipDone) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type Stdio

type Stdio struct {
	// contains filtered or unexported fields
}

func (*Stdio) Bootstrap

func (s *Stdio) Bootstrap(pipelineCtx Pipeline, next Next) (Next, error)

func (*Stdio) MarshalJSON

func (s *Stdio) MarshalJSON() ([]byte, error)

func (*Stdio) UnmarshalJSON

func (s *Stdio) UnmarshalJSON(b []byte) error

type Step

type Step interface {
	Processors() []Bootstraper
	Entrypoint() (Next, error)
}

type StepContext

type StepContext struct {
	Matrix map[string]interface{}

	Steps      map[string]*StepResult
	Envs       map[string]string
	Containers map[string]cruntime.ContainerStatus
	NamePrefix string
	Env        string
	Parent     string
	Output     string
	Stdin      io.Reader
	Stdout     *ioext.MultiWriter
	Stderr     *ioext.MultiWriter
	// contains filtered or unexported fields
}

func NewContext

func NewContext(dir string, inputs map[string]interface{}) StepContext

func (StepContext) Child

func (t StepContext) Child() StepContext

func (StepContext) DeepCopy

func (c StepContext) DeepCopy() StepContext

func (StepContext) FromV1Beta1

func (t StepContext) FromV1Beta1(vars *v1beta1.RuntimeVars)

func (StepContext) Merge

func (t StepContext) Merge(c StepContext) StepContext

func (StepContext) RuntimeVars

func (t StepContext) RuntimeVars() map[string]interface{}

func (StepContext) TmpDir

func (t StepContext) TmpDir() string

func (StepContext) ToV1Beta1

func (t StepContext) ToV1Beta1() *v1beta1.RuntimeVars

type StepResult

type StepResult struct {
	StartedAt time.Time
	EndedAt   time.Time
	Outputs   map[string]string
	Error     error
	DataDir   string
}

func (*StepResult) Duration

func (t *StepResult) Duration() time.Duration

type Teardown

type Teardown func(ctx context.Context) error

type Timeout

type Timeout struct {
	// contains filtered or unexported fields
}

func (*Timeout) Bootstrap

func (s *Timeout) Bootstrap(pipeline Pipeline, next Next) (Next, error)

type TmpDir added in v0.0.9

type TmpDir struct {
	// contains filtered or unexported fields
}

func (*TmpDir) Bootstrap added in v0.0.9

func (s *TmpDir) Bootstrap(pipeline Pipeline, next Next) (Next, error)

Jump to

Keyboard shortcuts

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