sandbox

package
v0.0.0-...-20b2a55 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VolumeBindings map[string]string
	Image          string
	HostName       string
	WorkDir        string
	Env            []string
	MemoryLimit    int64   // Memory limit in bytes
	CPULimit       float64 // CPU limit in cores
	NetworkEnabled bool
	Timeout        time.Duration // Command execution timeout in seconds
}

Config configures the sandbox environment

type DockerSandbox

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

DockerSandbox provides a containerized execution environment

func NewDockerSandbox

func NewDockerSandbox(ctx context.Context, config *Config) (*DockerSandbox, error)

NewDockerSandbox creates a new Docker sandbox with the given configuration

func (*DockerSandbox) Cleanup

func (s *DockerSandbox) Cleanup(ctx context.Context)

Cleanup cleans up sandbox resources

func (*DockerSandbox) Create

func (s *DockerSandbox) Create(ctx context.Context) error

Create creates and starts the sandbox container

func (*DockerSandbox) Exists

func (s *DockerSandbox) Exists(ctx context.Context, path string) (bool, error)

Exists checks if a path exists in the container

func (*DockerSandbox) IsDirectory

func (s *DockerSandbox) IsDirectory(ctx context.Context, path string) (bool, error)

IsDirectory checks if a path in the container is a directory

func (*DockerSandbox) ReadFile

func (s *DockerSandbox) ReadFile(ctx context.Context, path string) (string, error)

ReadFile reads a file from the container

func (*DockerSandbox) RunCommand

func (s *DockerSandbox) RunCommand(ctx context.Context, cmd []string) (*commandline.CommandOutput, error)

RunCommand executes a command with explicit arguments (no shell involved)

func (*DockerSandbox) WriteFile

func (s *DockerSandbox) WriteFile(ctx context.Context, path string, content string) error

WriteFile writes content to a file in the container

Jump to

Keyboard shortcuts

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