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 NewOutputWrapper(substep Step, reader io.Reader) *outputWrapperStep
- 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 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 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 ¶
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 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.
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.