Documentation
¶
Index ¶
- type Config
- type DockerSandbox
- func (s *DockerSandbox) Cleanup(ctx context.Context)
- func (s *DockerSandbox) Create(ctx context.Context) error
- func (s *DockerSandbox) Exists(ctx context.Context, path string) (bool, error)
- func (s *DockerSandbox) IsDirectory(ctx context.Context, path string) (bool, error)
- func (s *DockerSandbox) ReadFile(ctx context.Context, path string) (string, error)
- func (s *DockerSandbox) RunCommand(ctx context.Context, cmd []string) (*commandline.CommandOutput, error)
- func (s *DockerSandbox) WriteFile(ctx context.Context, path string, content string) error
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) IsDirectory ¶
IsDirectory checks if a path in the container is a directory
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)
Click to show internal directories.
Click to hide internal directories.