process

package
v0.212.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package process runs external commands while preserving structured failure information and allowing output to be captured, streamed, or both.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Path   string
	Args   []string
	Code   int
	Stderr string
	Cause  error
}

func (*Failure) Error

func (e *Failure) Error() string

func (*Failure) SensitiveArgs

func (e *Failure) SensitiveArgs() bool

func (*Failure) Unwrap

func (e *Failure) Unwrap() error

type Output

type Output struct {
	Stdout []byte
	Stderr []byte
}

func Run

func Run(ctx context.Context, spec Spec) (Output, error)

type Spec

type Spec struct {
	Path      string
	Args      []string
	Dir       string
	Env       []string
	Stdin     io.Reader
	Stdout    io.Writer
	Stderr    io.Writer
	Sensitive bool
	// Clean runs the process with exactly Env as its environment, without
	// inheriting the parent's (a tighter effect capability). When false, a
	// non-nil Env is appended to the inherited environment.
	Clean bool
}

Jump to

Keyboard shortcuts

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