Documentation ¶
Index ¶
- Constants
- Variables
- func NewCodependent(substeps []Step, errorOnExit bool) *codependentStep
- func NewDownload(container garden.Container, model models.DownloadAction, ...) *downloadStep
- func NewEmitProgress(substep Step, startMessage, successMessage, failureMessage string, ...) *emitProgressStep
- func NewParallel(substeps []Step) *parallelStep
- func NewRun(container garden.Container, model models.RunAction, ...) *runStep
- func NewSerial(steps []Step) *serialStep
- func NewTimeout(substep Step, timeout time.Duration, logger lager.Logger) *timeoutStep
- func NewTry(substep Step, logger lager.Logger) *tryStep
- func NewUpload(container garden.Container, model models.UploadAction, ...) *uploadStep
- type EmittableError
- type Step
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 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 NewTimeout ¶
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.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.