DefaultFastFail is the default value for fast fail.
var ( // DefaultMaxConcurrentCmds is the default value for the maximum // number of concurrent commands. DefaultMaxConcurrentCmds = runtime.NumCPU() // DefaultEventHandler is the default Event handler. DefaultEventHandler = logEvent // DefaultClock is the default function to use as a clock. DefaultClock = time.Now )
Cmd is a command to run.
ExecCmd returns a new Cmd for the given exec.Cmd.
ExecCmds returns a slice of Cmds for the given exec.Cmds.
Event is an event that happens during the runner's Run call.
EventType is an event type during the runner's run call.
const ( // EventTypeStarted says that the runner started. EventTypeStarted EventType = iota + 1 // EventTypeCmdStarted says that a command started. EventTypeCmdStarted // EventTypeCmdFinished says that a command finished. EventTypeCmdFinished // EventTypeFinished says that the runner finished. EventTypeFinished )
MarshalJSON marshals the EventType to JSON.
MarshalText marshals the EventType to text.
String returns a string representation of the EventType.
UnmarshalJSON unmarshals the EventType from JSON.
UnmarshalText unmarshals the EventType from text.
Runner runs the commands.
NewRunner returns a new Runner.
type RunnerOption func(*runner)
RunnerOption is an option for a new Runner.
WithClock returns a RunnerOption that will make the Runner use the given Clock.
WithEventHandler returns a RunnerOption that will use the given EventHandler.
WithFastFail returns a RunnerOption that will return error fun Run as soon as one of the commands fails.
WithMaxConcurrentCmds returns a RunnerOption that will make the Runner only run maxConcurrentCmds at once, or unlimited if 0.