local

package
v0.192.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 11 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

Overview

Package local implements the in-process (local host) runner. It executes the resolved command as a child process via exec.CommandContext and streams its stdout/stderr straight into the writers the job service provides. See plan §6.3 (Stdout/Stderr local-only convention) and §9 (P4).

Index

Constants

View Source
const Name = "local"

Name is the runner identifier ("local").

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct{}

Runner runs commands as local child processes.

func New

func New() *Runner

New returns a local runner.

func (*Runner) Name

func (r *Runner) Name() string

Name implements runner.Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, req runner.Request) runner.Result

Run executes req.Command with req.Args under ctx.

  • The working directory is req.WorkDir (the job service passes a SafeJoin'd absolute host path).
  • The environment is the process env (os.Environ) with req.Env layered on top, so agent-configured vars override inherited ones.
  • Stdout/Stderr are wired directly to the provided writers (the job service's stdout.log / stderr.log files) for live streaming.

Exit handling: a zero exit yields ExitCode 0. A non-zero process exit is read from *exec.ExitError. A context cancel/timeout surfaces as a non-zero exit with Err set to ctx.Err(); the job service inspects the context reason to distinguish cancelled vs timeout. A failure to start the process returns a synthetic exit code (-1) with the start error.

Jump to

Keyboard shortcuts

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