Documentation
¶
Overview ¶
Package executor abstracts OS command execution. Collectors that need to shell out (sysctl, sw_vers, lsb_release, loginctl, lscpu, etc.) accept an Executor so tests can assert the command + args and return canned stdout via a gomock-generated mock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
Execute(
ctx context.Context,
name string,
args ...string,
) ([]byte, error)
}
Executor runs OS commands and returns their combined stdout+stderr. Context cancellation propagates to the underlying process via exec.CommandContext — collectors can honor deadlines and SIGINT.
Shape is intentionally minimal (single method, combined output). Matches osapi's CommandExecutor with one addition: we thread context for cancellation, osapi passes timeout as an integer.