local

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package local implements running processes on the host.

It exists because of an amendment made on 2026-08-31: the original design required Kubernetes for any language that was not Go, which made developing on the instance itself impossible.

The boundary is code, not convention: New refuses to build the executor outside local mode. A `run:` with no declared limit is the real risk — not the command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrOutsideLocal added in v0.7.0

type ErrOutsideLocal struct{ Env string }

ErrOutsideLocal is returned when the executor is built outside local mode. Typed so a test can assert on it.

func (ErrOutsideLocal) Error added in v0.7.0

func (e ErrOutsideLocal) Error() string

type GoExecutor

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

GoExecutor roda tasks Go registradas, dentro do proprio processo.

It is section 14's executor: no container, no pod, no child process. That is exactly the gain — a simple Go task does not pay container startup, which was the measurement that motivated this project (a 38s cold start against 5s in the benchmark Brevis came out of).

Unlike the ProcessExecutor, there is NO environment restriction: the code here was compiled into the binary, so there is no arbitrary-execution surface.

func NewGoExecutor

func NewGoExecutor(reg *execution.Registry) *GoExecutor

func (*GoExecutor) Cancel

func (g *GoExecutor) Cancel(_ context.Context, execID string) error

func (*GoExecutor) Execute

func (g *GoExecutor) Execute(ctx context.Context, t execution.TaskExec) (<-chan execution.Event, error)

Execute resolves the task in the registry and runs it in a goroutine, streaming the eventos.

func (*GoExecutor) Name

func (g *GoExecutor) Name() string

type ProcessExecutor

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

ProcessExecutor runs arbitrary commands as host processes.

func New

func New(env string) (*ProcessExecutor, error)

New returns the executor, or refuses when the environment is not local.

func (*ProcessExecutor) Cancel

func (p *ProcessExecutor) Cancel(_ context.Context, execID string) error

Cancel interrupts a run in flight.

func (*ProcessExecutor) Execute

func (p *ProcessExecutor) Execute(ctx context.Context, t execution.TaskExec) (<-chan execution.Event, error)

Execute fires the command and returns the event channel. The channel closes when the process ends — the consumer can `range` over it with no extra coordination.

func (*ProcessExecutor) Name

func (p *ProcessExecutor) Name() string

Jump to

Keyboard shortcuts

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