Documentation
¶
Index ¶
- type Client
- func (c *Client) DeleteFile(ctx context.Context, filePath string) error
- func (c *Client) ReadFile(ctx context.Context, filePath string) (*fileContent, error)
- func (c *Client) RunBashCommand(ctx context.Context, cmd string, args []string, workdir string, ...) (*ExecResult, error)
- func (c *Client) RunPythonScript(ctx context.Context, script, workdir string, timeoutSeconds int) (*ExecResult, error)
- func (c *Client) WriteFile(ctx context.Context, filePath, content string) (*fileContent, error)
- type ExecResult
- type Manager
- type NotFoundError
- type SandboxHandle
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 ¶
DeleteFile deletes 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.
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
Click to show internal directories.
Click to hide internal directories.