pipelines

package
v0.0.1-prerelease9 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoltLogger

func BoltLogger[R glu.Resource](name string) func(Builder[R]) (typed.PhaseLogger[R], error)

BoltLogger returns an instance of type.PhaseLogger which writes to a boltdb file as configured by the provided name.

func GitPhase

func GitPhase[R srcgit.Resource](meta glu.Metadata, srcName string, opts ...containers.Option[srcgit.Phase[R]]) func(Builder[R]) (typed.UpdatablePhase[R], error)

GitPhase is a convenience function for building a git.Phase implementation using a pipeline builder implementation.

func OCIPhase

func OCIPhase[R srcoci.Resource](meta glu.Metadata, srcName string, opts ...containers.Option[srcoci.Phase[R]]) func(Builder[R]) (typed.Phase[R], error)

OCIPhase is a convenience function for building an oci.Phase implementation using a pipeline builder implementation.

Types

type Builder

type Builder[R glu.Resource] interface {
	New() R
	Context() context.Context
	PipelineName() string
	Configuration() *glu.Config
	Logger() typed.PhaseLogger[R]
}

Builder is used carry dependencies for building new phases

type PhaseBuilder

type PhaseBuilder[R glu.Resource] struct {
	*PipelineBuilder[R]
	// contains filtered or unexported fields
}

PhaseBuilder is used to chain building new phases with edges leading to the same phase.

func (*PhaseBuilder[R]) PromotesTo

func (b *PhaseBuilder[R]) PromotesTo(fn func(b Builder[R]) (typed.UpdatablePhase[R], error), ts ...triggers.Trigger) (next *PhaseBuilder[R])

PromotesTo creates a new phase and an edge to this new phase from the phase built in the receiver.

type PipelineBuilder

type PipelineBuilder[R glu.Resource] struct {
	// contains filtered or unexported fields
}

PipelineBuilder is a utility type for populating systems with type constrained pipelines. It has a number of utilities for simplifying common configuration options used to create types sources and phases within a typed pipeline.

func NewBuilder

func NewBuilder[R glu.Resource](system *glu.System, meta glu.Metadata, newFn func() R, opts ...containers.Option[PipelineBuilder[R]]) *PipelineBuilder[R]

NewBuilder constructs and configures a new pipeline builder.

func (*PipelineBuilder[R]) Build

func (b *PipelineBuilder[R]) Build() error

func (*PipelineBuilder[R]) Configuration

func (p *PipelineBuilder[R]) Configuration() *glu.Config

func (*PipelineBuilder[R]) Context

func (p *PipelineBuilder[R]) Context() context.Context

func (*PipelineBuilder[R]) Logger

func (p *PipelineBuilder[R]) Logger() typed.PhaseLogger[R]

func (*PipelineBuilder[R]) LogsTo

func (b *PipelineBuilder[R]) LogsTo(fn func(b Builder[R]) (typed.PhaseLogger[R], error)) *PipelineBuilder[R]

LogsTo invokes provided function to build a new logger which is then used throughout the rest of the pipeline.

func (*PipelineBuilder[R]) New

func (p *PipelineBuilder[R]) New() R

func (*PipelineBuilder[R]) NewPhase

func (b *PipelineBuilder[R]) NewPhase(fn func(b Builder[R]) (typed.Phase[R], error)) (next *PhaseBuilder[R])

NewPhase constructs a new phase and registers it on the resulting pipeline produced by the builder.

func (*PipelineBuilder[R]) PipelineName

func (p *PipelineBuilder[R]) PipelineName() string

Jump to

Keyboard shortcuts

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