sandbox

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package sandbox provides the `lango sandbox` CLI command group for inspecting OS-level process sandbox status and running smoke tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSandboxCmd

func NewSandboxCmd(cfgLoader func() (*config.Config, error), bootLoader BootLoader) *cobra.Command

NewSandboxCmd creates the top-level `lango sandbox` command.

cfgLoader runs lightweight bootstrap and returns only the config (closing the DB on the way out) — used by `sandbox test` which does not need the audit DB, and as the graceful-degradation fallback for `sandbox status` when `bootLoader` is unavailable. bootLoader runs the full bootstrap and returns the result with an open DBClient — used by `sandbox status` to query the sandbox decision audit trail.

`sandbox status` prefers bootLoader so that one bootstrap pass serves both the config rendering and the audit query (no double passphrase prompt). When bootLoader is nil or returns an error (signed-out, locked DB, non-interactive environments), status falls back to cfgLoader so the config / capabilities / backend availability sections still render — only the Recent Sandbox Decisions section is silently skipped.

Types

type BootLoader

type BootLoader func() (*bootstrap.Result, error)

BootLoader is the optional dependency that opens the encrypted application database so `lango sandbox status` can query the recent SandboxDecision audit trail. It is optional: if nil or if it returns an error (database locked, signed-out, missing), status renders without the Recent Decisions section so the command remains usable as a pure sandbox-layer diagnostic.

Jump to

Keyboard shortcuts

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