execx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Dir  string
	Name string
	Args []string
	// Stdin is optional input piped to the command's stdin.
	Stdin string
}

Command describes a subprocess execution.

type OSRunner

type OSRunner struct{}

OSRunner executes commands via os/exec.

func (OSRunner) Run

func (OSRunner) Run(ctx context.Context, cmd Command) (Result, error)

Run executes cmd and captures output.

func (OSRunner) RunStream

func (OSRunner) RunStream(ctx context.Context, cmd Command, handler StreamLineHandler) (Result, error)

RunStream executes cmd, streams output lines to handler, and captures output.

type Result

type Result struct {
	Stdout string
	Stderr string
}

Result is subprocess output.

type Runner

type Runner interface {
	Run(ctx context.Context, cmd Command) (Result, error)
}

Runner executes subprocesses.

type StreamLineHandler

type StreamLineHandler func(stream, line string)

StreamLineHandler receives one output line from a subprocess stream.

type StreamRunner

type StreamRunner interface {
	RunStream(ctx context.Context, cmd Command, handler StreamLineHandler) (Result, error)
}

StreamRunner is an optional runner that can stream line-by-line output.

Jump to

Keyboard shortcuts

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