Documentation
¶
Overview ¶
Package direct provides the default Sandbox implementation for exec hooks: it spawns the command as a local subprocess via exec.CommandContext.
This is the built-in, zero-config behavior. When ExecHookConfig.Sandbox is nil, the exec hooks fall back to direct.New() — so existing deployments get the exact same semantics they had before the Sandbox abstraction was introduced.
Index ¶
Constants ¶
const ModeName = "direct"
ModeName is the mode identifier under which this backend registers with sandbox.RegisterFactory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sandbox ¶
type Sandbox struct {
// contains filtered or unexported fields
}
Sandbox runs exec-hook commands as local subprocesses.
func New ¶
New returns a direct-mode sandbox with the given display name. An empty name defaults to "direct".
func (*Sandbox) Spawn ¶
Spawn runs req.Command locally, piping req.Stdin into its stdin and collecting stdout and stderr. req.Env entries are merged on top of the host environment: each entry is either a bare env var name (its value is looked up on the host and forwarded) or a "KEY=value" pair (forwarded verbatim). A timeout or non-zero exit surfaces as a non-nil Response.Err.