executor

package
v1.17.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 17 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmd *exec.Cmd) error

Run starts the command, waits for it to complete, and returns the error. The child PID is registered in the global process registry while the process is running so that a PID-1 zombie reaper does not steal it.

Types

type CmdUsage

type CmdUsage struct {
	Sys    time.Duration
	User   time.Duration
	MaxRss int64
}

type Executor added in v1.5.2

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

func NewExecutor added in v1.5.2

func NewExecutor(dir string, entrypoint string, args []string, envs []string) *Executor

func (*Executor) Output added in v1.5.2

func (e *Executor) Output() ([]byte, error)

func (*Executor) RunAndLogLines added in v1.5.2

func (e *Executor) RunAndLogLines(ctx context.Context, logLabels map[string]string) (*CmdUsage, error)

func (*Executor) WithCMDStderr added in v1.5.2

func (e *Executor) WithCMDStderr(w io.Writer) *Executor

func (*Executor) WithCMDStdout added in v1.5.2

func (e *Executor) WithCMDStdout(w io.Writer) *Executor

func (*Executor) WithChroot added in v1.6.0

func (e *Executor) WithChroot(path string) *Executor

func (*Executor) WithLogProxyHookJSON added in v1.5.2

func (e *Executor) WithLogProxyHookJSON(logProxyHookJSON bool) *Executor

func (*Executor) WithLogProxyHookJSONKey added in v1.5.2

func (e *Executor) WithLogProxyHookJSONKey(logProxyHookJSONKey string) *Executor

func (*Executor) WithLogger added in v1.5.2

func (e *Executor) WithLogger(logger *log.Logger) *Executor

type ProcessTracker added in v1.17.5

type ProcessTracker interface {
	// IsActive reports whether pid is currently tracked as a running process.
	IsActive(pid int) bool
}

ProcessTracker is a read-only view into the process registry. It is intended for consumers (such as a PID-1 zombie reaper) that need to check whether a PID is managed by the executor but must not modify the registry.

func Tracker added in v1.17.5

func Tracker() ProcessTracker

Tracker returns a read-only view of the global process registry. The zombie reaper should call this once and use the returned ProcessTracker to check whether a PID is managed by the executor.

type StderrError added in v1.16.4

type StderrError struct {
	Message string
}

StderrError is returned by RunAndLogLines when a command fails and produces output on stderr. Callers can use errors.As to access the raw stderr content.

func (*StderrError) Error added in v1.16.4

func (e *StderrError) Error() string

Jump to

Keyboard shortcuts

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