steps

package
v0.0.0-...-1ada680 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCreateTmpDir    = "Failed to create temp dir"
	ErrEstablishStream = "Failed to establish stream from container"
	ErrReadTar         = "Failed to find first item in tar stream"
	ErrCreateTmpFile   = "Failed to create temp file"
	ErrCopyStreamToTmp = "Failed to copy stream contents into temp file"
)
View Source
const ExitTimeout = 1 * time.Second
View Source
const TerminateTimeout = 10 * time.Second

Variables

View Source
var CodependentStepExitedError = errors.New("Codependent step exited")
View Source
var ErrCancelled = errors.New("cancelled")
View Source
var ErrExitTimeout = errors.New("process did not exit")

Functions

func NewCodependent

func NewCodependent(substeps []Step, errorOnExit bool) *codependentStep

func NewDownload

func NewDownload(
	container garden.Container,
	model models.DownloadAction,
	cachedDownloader cacheddownloader.CachedDownloader,
	rateLimiter chan struct{},
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
) *downloadStep

func NewEmitProgress

func NewEmitProgress(
	substep Step,
	startMessage,
	successMessage,
	failureMessage string,
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
) *emitProgressStep

func NewOutputWrapper

func NewOutputWrapper(substep Step, reader io.Reader) *outputWrapperStep

This step ignores the error from the substep and returns the content of Reader as an emittable error. This is used to wrap the output of the healthcheck as the error instead of using the exit status or the process

func NewParallel

func NewParallel(substeps []Step) *parallelStep

func NewRun

func NewRun(
	container garden.Container,
	model models.RunAction,
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
	externalIP string,
	internalIP string,
	portMappings []executor.PortMapping,
	exportNetworkEnvVars bool,
	clock clock.Clock,
	suppressExitStatusCode bool,
) *runStep

func NewSerial

func NewSerial(steps []Step) *serialStep

func NewTimeout

func NewTimeout(substep Step, timeout time.Duration, logger lager.Logger) *timeoutStep

func NewTry

func NewTry(substep Step, logger lager.Logger) *tryStep

func NewUpload

func NewUpload(
	container garden.Container,
	model models.UploadAction,
	uploader uploader.Uploader,
	compressor compressor.Compressor,
	tempDir string,
	streamer log_streamer.LogStreamer,
	rateLimiter chan struct{},
	logger lager.Logger,
) *uploadStep

Types

type EmittableError

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

func NewEmittableError

func NewEmittableError(wrappedError error, message string, args ...interface{}) *EmittableError

func (*EmittableError) Error

func (e *EmittableError) Error() string

func (*EmittableError) WrappedError

func (e *EmittableError) WrappedError() error

type Step

type Step interface {
	// Perform synchronously performs something.
	//
	// If cancelled, it should return ErrCancelled (or an error wrapping it).
	Perform() error

	// Cancel asynchronously interrupts a running Perform().
	//
	// It can be called more than once, and should be idempotent.
	//
	// If the step is already completed, it is a no-op.
	//
	// If the step is cancelled, and then starts performing, it should
	// immediately cancel.
	Cancel()
}

A step describes a synchronous action that can be interrupted.

They can be composed arbitrarily assuming everyone's following the rules below.

func NewLongRunningMonitor

func NewLongRunningMonitor(
	readinessCheck Step,
	livenessCheck Step,
	hasStartedRunning chan<- struct{},
	logger lager.Logger,
	clock clock.Clock,
	logStreamer log_streamer.LogStreamer,
	healthcheckStreamer log_streamer.LogStreamer,
	startTimeout time.Duration,
) Step

func NewMonitor

func NewMonitor(
	checkFunc func() Step,
	hasStartedRunning chan<- struct{},
	logger lager.Logger,
	clock clock.Clock,
	logStreamer log_streamer.LogStreamer,
	startTimeout time.Duration,
	healthyInterval time.Duration,
	unhealthyInterval time.Duration,
	workPool *workpool.WorkPool,
) Step

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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