sandbox

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	R = Registry{
		// contains filtered or unexported fields
	}
)

Functions

This section is empty.

Types

type Env added in v0.0.8

type Env map[string]string

type Filesystem

type Filesystem struct {
	FullDiskReadAccess bool `toml:"fullDiskReadAccess"`
	NoCache            bool `toml:"noCache"`

	ROPaths   []string `toml:"roPaths"`
	RWPaths   []string `toml:"rwPaths"`
	DenyPaths []string `toml:"denyPaths"`
}

type Network

type Network struct {
	Deny bool `toml:"deny"`
}

type Policy

type Policy struct {
	Env        Env        `toml:"env"`
	Filesystem Filesystem `toml:"fs"`
	Network    Network    `toml:"net"`
}

func MergePolicies added in v0.0.5

func MergePolicies(p1, p2 Policy) (Policy, error)

type Registry

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

func (Registry) Lookup

func (r Registry) Lookup(id string) (Sandbox, bool)

func (Registry) Register

func (r Registry) Register(id string, s Sandbox)

type Sandbox

type Sandbox interface {
	Exec(ctx context.Context, cmd []string, policy Policy, logger *slog.Logger) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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