command

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package command runs local inspection commands with bounded resources.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutputLimit = errors.New("command output exceeds limit")
)

Functions

func Run

func Run(ctx context.Context, executable string, env []string, args ...string) ([]byte, error)

Run returns stdout on success and stdout plus stderr on failure. Each stream is limited to 4 MiB and execution to five seconds. A nil env inherits the process environment. Earlier caller cancellation/deadlines remain effective.

func RunWithLimits

func RunWithLimits(parent context.Context, timeout time.Duration, outputLimit int, executable string, env []string, args ...string) ([]byte, error)

RunWithLimits is Run with operation-specific timeout and per-stream byte limits. Oversized output fails rather than returning a successful truncated response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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