process

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackgroundCommand

func BackgroundCommand(name string, args ...string) *exec.Cmd

Create a command configured for background execution

func BackgroundCommandContext

func BackgroundCommandContext(ctx context.Context, name string, args ...string) *exec.Cmd

Create a cancellable command configured for background execution

func Capture

func Capture(command *exec.Cmd, options CaptureOptions) (string, error)

Capture bounds combined stdout/stderr without creating a shell or starting a timer

func Run

func Run(ctx context.Context, name string, args ...string) (string, error)

Run a command with default resource limits

func RunWithOptions

func RunWithOptions(ctx context.Context, options Options, name string, args ...string) (string, error)

Run a command with explicit timeout and output limits

Types

type BoundedOutput

type BoundedOutput struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

func (*BoundedOutput) Overflow

func (b *BoundedOutput) Overflow() bool

Report whether captured output exceeded its limit

func (*BoundedOutput) Write

func (b *BoundedOutput) Write(p []byte) (int, error)

Capture output up to the limit while reporting the original write length

type CaptureOptions

type CaptureOptions struct {
	OutputLimit int
	WaitDelay   time.Duration
	Truncate    bool
}

CaptureOptions retains caller-owned command configuration and cancellation

type Options

type Options struct {
	Timeout     time.Duration
	OutputLimit int
	WaitDelay   time.Duration
	Directory   string
	Environment []string
}

Jump to

Keyboard shortcuts

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