sandbox

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client talks to a sandbox daemon inside a sandbox pod.

func NewClient

func NewClient(handle *SandboxHandle) *Client

NewClient constructs a client for the given sandbox handle.

func (*Client) DeleteFile

func (c *Client) DeleteFile(ctx context.Context, filePath string) error

DeleteFile deletes a file from the sandbox filesystem.

func (*Client) ReadFile

func (c *Client) ReadFile(ctx context.Context, filePath string) (*fileContent, error)

ReadFile reads a file from the sandbox filesystem.

func (*Client) RunBashCommand

func (c *Client) RunBashCommand(ctx context.Context, cmd string, args []string, workdir string, timeoutSeconds int) (*ExecResult, error)

RunBashCommand executes a bash command inside the sandbox.

func (*Client) RunPythonScript

func (c *Client) RunPythonScript(ctx context.Context, script, workdir string, timeoutSeconds int) (*ExecResult, error)

RunPythonScript executes a Python script inside the sandbox.

func (*Client) WriteFile

func (c *Client) WriteFile(ctx context.Context, filePath, content string) (*fileContent, error)

WriteFile writes content to a file in the sandbox filesystem.

type ExecResult

type ExecResult struct{}

type Manager

type Manager interface {
	// CreateSandbox ensures a sandbox exists for the given session, creating one if needed.
	CreateSandbox(ctx context.Context, image string, agentName string, namespace string, sessionID string) (*SandboxHandle, error)
	// GetSandbox returns the handle for an existing sandbox.
	GetSandbox(ctx context.Context, sessionID string) (*SandboxHandle, error)
	// DeleteSandbox tears down the sandbox for the given session.
	DeleteSandbox(ctx context.Context, sessionID string) error
}

Manager defines the lifecycle operations for sandboxes.

type NotFoundError

type NotFoundError struct {
	SessionID string
}

NotFoundError is returned when a sandbox for a given session does not exist.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type SandboxHandle

type SandboxHandle struct {
	SessionID string
	PodName   string
	PodIP     string
	Port      int
}

SandboxHandle represents a running sandbox pod bound to a session.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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