processrunner

package
v0.11.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package processrunner executes bounded subprocess trees on Unix and Windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedOutput

func CombinedOutput(ctx context.Context, cmd *exec.Cmd) ([]byte, error)

func Run

func Run(ctx context.Context, cmd *exec.Cmd) error

Run owns a process group, bounds pipe draining and terminates descendants when the invocation ends. Callers configure command arguments/env/IO normally; process attributes are owned here so children cannot evade cancellation by inheriting the application's process group.

Types

type OutputCapture

type OutputCapture struct {
	// contains filtered or unexported fields
}

OutputCapture drains arbitrary process output while retaining a bounded prefix and suffix. The suffix preserves final diagnostics/completion markers.

func NewOutputCapture

func NewOutputCapture(limit int) *OutputCapture

func (*OutputCapture) Snapshot

func (c *OutputCapture) Snapshot() (string, int64, bool)

func (*OutputCapture) Write

func (c *OutputCapture) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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