Documentation
¶
Overview ¶
Package execgo is the fleet's one typed wrapper for running external commands — so no tool scatters raw os/exec.Command with ad-hoc output handling. A Command is built with functional options, Run captures a typed Result (stdout/stderr/exit/duration), and a non-zero exit becomes a typed, severity- and exit-code-carrying error via errors-go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
Name string
Args []string
Env []string // appended to os.Environ() unless EnvOnly is set
EnvOnly bool
Dir string
Stdin []byte
Timeout time.Duration // 0 = no timeout (ctx still governs)
}
Command is a typed, options-built external command.
type Option ¶
type Option func(*Command)
Option configures a Command.
func WithEnvOnly ¶
WithEnvOnly replaces (does not append to) the environment.
func WithTimeout ¶
WithTimeout bounds the run (in addition to the caller's context).