- type Cmd
- type Event
- type EventType
- type Runner
- type RunnerOption
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.
Event is an event that happens during the runner's Run call.
type EventType int
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 )
func (EventType) MarshalJSON ¶
MarshalJSON marshals the EventType to JSON.
func (EventType) MarshalText ¶
MarshalText marshals the EventType to text.
String returns a string representation of the EventType.
func (*EventType) UnmarshalJSON ¶
UnmarshalJSON unmarshals the EventType from JSON.
Runner runs the commands.
type RunnerOption ¶
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.
func WithEventHandler ¶
WithEventHandler returns a RunnerOption that will use the given EventHandler.
func WithFastFail ¶
func WithFastFail() RunnerOption
WithFastFail returns a RunnerOption that will return error fun Run as soon as one of the commands fails.