sandbox

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicSandbox

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

func NewBasicSandbox

func NewBasicSandbox(workDir string) *BasicSandbox

func (*BasicSandbox) Execute

func (s *BasicSandbox) Execute(ctx context.Context, cmd string, args ...string) ([]byte, error)

func (*BasicSandbox) ReadFile

func (s *BasicSandbox) ReadFile(path string) ([]byte, error)

func (*BasicSandbox) Remove

func (s *BasicSandbox) Remove(path string) error

func (*BasicSandbox) WriteFile

func (s *BasicSandbox) WriteFile(path string, data []byte) error

type DockerSandbox

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

func NewDockerSandbox

func NewDockerSandbox(image string) *DockerSandbox

func (*DockerSandbox) Execute

func (d *DockerSandbox) Execute(ctx context.Context, cmd string, args ...string) ([]byte, error)

func (*DockerSandbox) ReadFile

func (d *DockerSandbox) ReadFile(path string) ([]byte, error)

func (*DockerSandbox) Remove

func (d *DockerSandbox) Remove(path string) error

func (*DockerSandbox) SetTimeout

func (d *DockerSandbox) SetTimeout(timeout time.Duration)

func (*DockerSandbox) SetWorkDir

func (d *DockerSandbox) SetWorkDir(dir string)

func (*DockerSandbox) WriteFile

func (d *DockerSandbox) WriteFile(path string, data []byte) error

type Sandbox

type Sandbox interface {
	Execute(ctx context.Context, cmd string, args ...string) ([]byte, error)
	ReadFile(path string) ([]byte, error)
	WriteFile(path string, data []byte) error
	Remove(path string) error
}

Jump to

Keyboard shortcuts

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