models

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: GPL-2.0, GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposableDataStream

type ComposableDataStream struct {
	Name string
	// contains filtered or unexported fields
}

func NewClosedComposableDataStreamFromBuffer

func NewClosedComposableDataStreamFromBuffer(buffer *bytes.Buffer) *ComposableDataStream

func NewComposableDataStream

func NewComposableDataStream(name string, errorHandler func(error)) *ComposableDataStream

func (*ComposableDataStream) Bytes

func (stream *ComposableDataStream) Bytes() []byte

func (*ComposableDataStream) Close

func (stream *ComposableDataStream) Close()

func (*ComposableDataStream) Closed

func (stream *ComposableDataStream) Closed() bool

func (*ComposableDataStream) Completed

func (stream *ComposableDataStream) Completed() bool

func (*ComposableDataStream) Copy

func (stream *ComposableDataStream) Copy() io.Reader

func (*ComposableDataStream) CopyOrResult

func (stream *ComposableDataStream) CopyOrResult() io.Reader

func (*ComposableDataStream) Intercept

func (stream *ComposableDataStream) Intercept() io.ReadWriteCloser

func (*ComposableDataStream) Len

func (stream *ComposableDataStream) Len() int

func (*ComposableDataStream) MergeWith

func (stream *ComposableDataStream) MergeWith(newReader io.Reader)

func (*ComposableDataStream) Replace

func (stream *ComposableDataStream) Replace(reader io.Reader)

func (*ComposableDataStream) StartCopyingInto

func (stream *ComposableDataStream) StartCopyingInto(writer io.Writer)

func (*ComposableDataStream) String

func (stream *ComposableDataStream) String() string

func (*ComposableDataStream) Wait

func (stream *ComposableDataStream) Wait()

func (*ComposableDataStream) WriteCloser

func (stream *ComposableDataStream) WriteCloser() io.WriteCloser

type ComposableDataStreamIntercept

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

func NewComposableDataStreamIntercept

func NewComposableDataStreamIntercept(reader io.Reader, writer io.WriteCloser, errorHandler func(error)) *ComposableDataStreamIntercept

func (*ComposableDataStreamIntercept) Close

func (intercept *ComposableDataStreamIntercept) Close() error

func (*ComposableDataStreamIntercept) Read

func (intercept *ComposableDataStreamIntercept) Read(p []byte) (int, error)

func (*ComposableDataStreamIntercept) Write

func (intercept *ComposableDataStreamIntercept) Write(p []byte) (int, error)

type DefaultSettings

type DefaultSettings struct {
	Command string
	Dir     string
}

type HookDefinitions

type HookDefinitions = map[string][]string

type PipelineDefinition

type PipelineDefinition struct {
	BuiltIn             bool
	DefinitionArguments map[string]interface{}
	FileName            string
	Public              bool
}

func NewPipelineDefinition

func NewPipelineDefinition(
	arguments map[string]interface{},
	pipelineFile PipelineFile,
	isPublic bool,
	isBuiltIn bool,
) *PipelineDefinition

type PipelineDefinitionsLookup

type PipelineDefinitionsLookup = map[string][]PipelineDefinition

type PipelineFile

type PipelineFile struct {
	Default  DefaultSettings
	FileName string
	Hooks    HookDefinitions
	Import   []string
	// in pipeline files, each command can have arbitrary parameters
	// it may also have "steps"
	// each step can be either a string referencing another pipeline
	// or a dictionary containing additional parameters
	Public  map[string]map[string]interface{}
	Private map[string]map[string]interface{}
}

type PipelineFileImportSkeleton

type PipelineFileImportSkeleton struct {
	Import []string
}

type PipelineRun

type PipelineRun struct {

	// if the identifier has been defined before, this will be the resolved reference to the definition
	Definition *PipelineDefinition
	// an optional identifier - note that anonymous pipes without identifier can have invocation arguments, but no definition
	Identifier *string
	// the invocation arguments are what is passed to the pipe at the time of invocation / run creation
	InvocationArguments map[string]interface{}

	Stdin    *ComposableDataStream
	Stdout   *ComposableDataStream
	Stderr   *ComposableDataStream
	ExitCode *int

	Log *PipelineRunLogger

	Parent *PipelineRun

	LogClosingWaitGroup *sync.WaitGroup

	Synchronous    bool
	StartWaitGroup *sync.WaitGroup
	// contains filtered or unexported fields
}

a pipeline run contains everything needed to actually execute the invocation of a pipe the middleware operates on these objects, triggering further runs or shell invocations there are three steps to this process:

  1. Setup In the setup phase the arguments, connections between inputs and outputs, etc. of each run are defined.
  2. Finalization After the setup, finalize() is called to prevent any further changes to input/output connections.
  3. Execution The shell command is executed and data is piped through the defined input/output connections. Note that some middleware might start additional runs in the execution phase. For example, the `when` middleware for conditional execution will trigger runs based on whether the result of previous runs satisfies a certain condition

func NewPipelineRun

func NewPipelineRun(
	identifier *string,
	invocationArguments map[string]interface{},
	definition *PipelineDefinition,
	parent *PipelineRun,
) (*PipelineRun, error)

func (*PipelineRun) AddCancelHook

func (run *PipelineRun) AddCancelHook(cancelHook func() error)

func (*PipelineRun) ArgumentAtPath

func (run *PipelineRun) ArgumentAtPath(path ...string) (interface{}, error)

func (*PipelineRun) ArgumentAtPathIncludingParents

func (run *PipelineRun) ArgumentAtPathIncludingParents(path ...string) (interface{}, error)

func (*PipelineRun) ArgumentsCopy

func (run *PipelineRun) ArgumentsCopy() map[string]interface{}

func (*PipelineRun) Cancel

func (run *PipelineRun) Cancel() error

func (*PipelineRun) Cancelled

func (run *PipelineRun) Cancelled() bool

func (*PipelineRun) Close

func (run *PipelineRun) Close()

func (*PipelineRun) Completed

func (run *PipelineRun) Completed() bool

func (*PipelineRun) SetArgumentAtPath

func (run *PipelineRun) SetArgumentAtPath(value interface{}, path ...string) error

func (*PipelineRun) SetArguments

func (run *PipelineRun) SetArguments(value map[string]interface{})

func (*PipelineRun) String

func (run *PipelineRun) String() string

func (*PipelineRun) Wait

func (run *PipelineRun) Wait()

type PipelineRunLogger

type PipelineRunLogger struct {
	Indentation int

	ErrorCallback func(error)
	// contains filtered or unexported fields
}

func NewClosedPipelineRunLoggerWithErrors

func NewClosedPipelineRunLoggerWithErrors(errors *multierror.Error) *PipelineRunLogger

func NewClosedPipelineRunLoggerWithResult

func NewClosedPipelineRunLoggerWithResult(buffer *bytes.Buffer) *PipelineRunLogger

func NewPipelineRunLogger

func NewPipelineRunLogger(run *PipelineRun, indentation int) *PipelineRunLogger

func (*PipelineRunLogger) AddReaderEntry

func (logger *PipelineRunLogger) AddReaderEntry(reader io.Reader)

func (*PipelineRunLogger) AddWriteCloserEntry

func (logger *PipelineRunLogger) AddWriteCloserEntry() io.WriteCloser

func (*PipelineRunLogger) AllErrorMessages

func (logger *PipelineRunLogger) AllErrorMessages() []string

func (*PipelineRunLogger) Bytes

func (logger *PipelineRunLogger) Bytes() []byte

func (*PipelineRunLogger) Close

func (logger *PipelineRunLogger) Close()

func (*PipelineRunLogger) Closed

func (logger *PipelineRunLogger) Closed() bool

func (*PipelineRunLogger) Completed

func (logger *PipelineRunLogger) Completed() bool

func (*PipelineRunLogger) Debug

func (logger *PipelineRunLogger) Debug(entry *logrus.Entry)

func (*PipelineRunLogger) DebugCount

func (logger *PipelineRunLogger) DebugCount() int

func (*PipelineRunLogger) DebugWithFields

func (logger *PipelineRunLogger) DebugWithFields(fields ...log_fields.LogEntryField)

func (*PipelineRunLogger) Error

func (logger *PipelineRunLogger) Error(err error, fields ...log_fields.LogEntryField)

func (*PipelineRunLogger) ErrorCount

func (logger *PipelineRunLogger) ErrorCount() int

func (*PipelineRunLogger) Info

func (logger *PipelineRunLogger) Info(entry *logrus.Entry)

func (*PipelineRunLogger) InfoCount

func (logger *PipelineRunLogger) InfoCount() int

func (*PipelineRunLogger) InfoWithFields

func (logger *PipelineRunLogger) InfoWithFields(fields ...log_fields.LogEntryField)

func (*PipelineRunLogger) LastError

func (logger *PipelineRunLogger) LastError() error

func (*PipelineRunLogger) Level

func (logger *PipelineRunLogger) Level() logrus.Level

func (*PipelineRunLogger) PossibleError

func (logger *PipelineRunLogger) PossibleError(err error)

func (*PipelineRunLogger) PossibleErrorWithExplanation

func (logger *PipelineRunLogger) PossibleErrorWithExplanation(err error, explanation string)

func (*PipelineRunLogger) Reader

func (logger *PipelineRunLogger) Reader() io.Reader

func (*PipelineRunLogger) SetLevel

func (logger *PipelineRunLogger) SetLevel(level logrus.Level)

func (*PipelineRunLogger) StderrOutput

func (logger *PipelineRunLogger) StderrOutput(message string, fields ...log_fields.LogEntryField)

func (*PipelineRunLogger) String

func (logger *PipelineRunLogger) String() string

func (*PipelineRunLogger) Summary

func (logger *PipelineRunLogger) Summary() string

func (*PipelineRunLogger) Trace

func (logger *PipelineRunLogger) Trace(entry *logrus.Entry)

func (*PipelineRunLogger) TraceCount

func (logger *PipelineRunLogger) TraceCount() int

func (*PipelineRunLogger) TraceWithFields

func (logger *PipelineRunLogger) TraceWithFields(fields ...log_fields.LogEntryField)

func (*PipelineRunLogger) Wait

func (logger *PipelineRunLogger) Wait()

func (*PipelineRunLogger) Warn

func (logger *PipelineRunLogger) Warn(entry *logrus.Entry)

func (*PipelineRunLogger) WarnCount

func (logger *PipelineRunLogger) WarnCount() int

func (*PipelineRunLogger) WarnWithFields

func (logger *PipelineRunLogger) WarnWithFields(fields ...log_fields.LogEntryField)

Jump to

Keyboard shortcuts

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