executor

package
v1.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 6 Imported by: 0

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.

func Run

func Run(ctx context.Context, cfg Config) []Result

Run executes cfg.Command in each target directory concurrently. Results are returned in the same order as cfg.Targets.

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".

type Target

type Target struct {
	Path   string `json:"path"`
	Branch string `json:"branch"`
	Task   string `json:"task"`
}

Target represents a worktree to execute a command in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL