exec

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package exec runs external commands with consistent timeout, cancellation, and process-group handling. Run captures combined stdout+stderr; RunStdout captures stdout only (detection parsers depend on a banner-free stdout). On timeout/cancellation the whole process group is killed (see proc_unix.go) and the result is classified as ExitCodeTimeout/ExitCodeCanceled.

Index

Constants

View Source
const (
	// ExitCodeTimeout / ExitCodeCanceled are synthetic exit codes the runner
	// returns when a command is killed by its deadline or by user cancellation.
	ExitCodeTimeout  = 124
	ExitCodeCanceled = 130
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, args []string, timeout time.Duration) (string, int, time.Duration, error)

Run executes a command capturing combined stdout+stderr.

func RunStdout

func RunStdout(ctx context.Context, args []string, timeout time.Duration) (string, int, time.Duration, error)

RunStdout executes a command capturing stdout only (stderr discarded).

Types

This section is empty.

Jump to

Keyboard shortcuts

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