steps

package
Version: v0.1441.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: Apache-2.0 Imports: 22 Imported by: 2

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 EXIT_TIMEOUT = 1 * time.Minute
View Source
const TERMINATE_TIMEOUT = 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 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,
	portMappings []executor.PortMapping,
	exportNetworkEnvVars bool,
	clock clock.Clock,
) *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 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