Documentation
¶
Index ¶
Constants ¶
View Source
const EvalWrapperScript = "_pyexec_eval.py"
EvalWrapperScript is the name of the wrapper script for REPL-style evaluation
View Source
const ResultMarker = "___PYEXEC_RESULT___"
ResultMarker is the delimiter used to identify the expression result in stdout
Variables ¶
This section is empty.
Functions ¶
func GetEvalWrapperCode ¶
func GetEvalWrapperCode() string
GetEvalWrapperCode returns the Python wrapper code for REPL-style evaluation
Types ¶
type DockerExecutor ¶
type DockerExecutor struct {
// contains filtered or unexported fields
}
DockerExecutor implements the Executor interface using Docker
func NewDockerExecutor ¶
func NewDockerExecutor(cfg *config.Config) (*DockerExecutor, error)
NewDockerExecutor creates a new Docker-based executor
func (*DockerExecutor) Close ¶
func (e *DockerExecutor) Close() error
Close closes the Docker client
func (*DockerExecutor) Execute ¶
func (e *DockerExecutor) Execute(ctx context.Context, req *ExecutionRequest) (*ExecutionOutput, error)
Execute runs code in a Docker container
type ExecutionOutput ¶
ExecutionOutput contains the execution results
type ExecutionRequest ¶
ExecutionRequest contains all data needed for execution
type Executor ¶
type Executor interface {
// Execute runs code in a sandboxed environment
Execute(ctx context.Context, req *ExecutionRequest) (*ExecutionOutput, error)
// Kill terminates a running execution
Kill(ctx context.Context, containerID string) error
// Close cleans up executor resources
Close() error
}
Executor defines the interface for code execution
Click to show internal directories.
Click to hide internal directories.