sandbox

package
v0.2.78 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 30 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

Index

Constants

View Source
const Curl = "curl"
View Source
const Snapshot = "20261118T191519Z"

Snapshot is the Ubuntu archive moment every package of the guest image comes from.

Variables

View Source
var ErrPreparing = errors.New("the first start builds the sandbox's Ubuntu image, which takes a minute or two; commands wait for it")

Functions

func BuildImage

func BuildImage(ctx context.Context, snapshot, arch, dst, cgroup string) (installed []string, release string, err error)

func CheckCommandName

func CheckCommandName(name string) error

func Guest

func Guest(args []string) (code int, ok bool)

Types

type Bubblewrap added in v0.2.31

type Bubblewrap struct{}

func (Bubblewrap) Prepare added in v0.2.31

func (Bubblewrap) Prepare(ctx context.Context, dir string, log *slog.Logger) *Runtime

type BuildError

type BuildError struct {
	Err    error
	Output []byte
}

func (*BuildError) Error

func (e *BuildError) Error() string

func (*BuildError) Unwrap

func (e *BuildError) Unwrap() error

type Command

type Command struct {
	Script   string
	Stdin    string
	Cwd      string
	Dir      string
	ReadOnly []string
	Env      []string
	Commands []string
	Timeout  time.Duration
}

type Host

type Host interface {
	Command(ctx context.Context, log *slog.Logger, name string, args []string, cwd string, stdin io.Reader, stdout, stderr io.Writer) int
}

type None added in v0.2.31

type None struct{}

func (None) Prepare added in v0.2.31

func (None) Prepare(context.Context, string, *slog.Logger) *Runtime

type Result

type Result struct {
	Output    []byte
	ExitCode  int
	TimedOut  bool
	Truncated bool
}

type Runtime

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

func (*Runtime) Err

func (rt *Runtime) Err() error

func (*Runtime) Run

func (rt *Runtime) Run(ctx context.Context, cmd *Command, host Host) (Result, error)

func (*Runtime) Wait

func (rt *Runtime) Wait(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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