Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Targets []Target
Command string
Concurrency int // 0 = len(Targets)
FailFast bool
Runner RunFunc
}
Config bundles all parameters for a parallel execution run.
type Result ¶
type Result struct {
Target Target
ExitCode int
Stdout []byte
Stderr []byte
Err error // non-nil only if process couldn't start
Cancelled bool // true if skipped due to fail-fast
}
Result holds the outcome of executing a command in a single target.
type RunFunc ¶
type RunFunc func(ctx context.Context, dir, command string) (stdout, stderr []byte, exitCode int, err error)
RunFunc executes a shell command in a directory and returns its output. Non-zero exit codes are reported via exitCode (not err). err is non-nil only when the process could not start.
func ShellRunner ¶
func ShellRunner() RunFunc
ShellRunner returns a RunFunc that executes commands via "sh -c".
Click to show internal directories.
Click to hide internal directories.