Documentation
¶
Index ¶
- type CheckpointHook
- type RunRequest
- type Runner
- func (r *Runner) Execute(ctx context.Context, req RunRequest) (*models.Run, error)
- func (r *Runner) ExecutePrepared(ctx context.Context, req RunRequest, run *models.Run) (*models.Run, error)
- func (r *Runner) PrepareAsync(ctx context.Context, req RunRequest) (*models.Run, error)
- func (r *Runner) SetCheckpointHook(hook CheckpointHook)
- func (r *Runner) Stream(ctx context.Context, req RunRequest, stdout, stderr io.Writer) (*models.Run, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckpointHook ¶ added in v0.3.1
type CheckpointHook func(ctx context.Context, sessionID, runID uuid.UUID, exitCode int, durationMs int64, stdout, stderr string) error
CheckpointHook is called after successful command execution to create a checkpoint
type RunRequest ¶
type RunRequest struct {
SessionID uuid.UUID
ContainerID string
Command string
Args []string
Env map[string]string // persisted to DB; must NOT contain resolved secrets
SecretEnv map[string]string // injected into the container but never persisted
WorkingDir string
TimeoutSeconds int
Actor string
CallbackURL string // empty = no async callback
WorkspacePath string // host path of the session workspace; used for artifact detection
}
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner coordinates command execution inside sandbox containers.
func (*Runner) Execute ¶
Execute runs a command inside the sandbox container, persists the run record, and emits audit events. Output is buffered and returned in the Run model.
func (*Runner) ExecutePrepared ¶
func (r *Runner) ExecutePrepared(ctx context.Context, req RunRequest, run *models.Run) (*models.Run, error)
ExecutePrepared executes a command for an already-prepared run (created by PrepareAsync). Safe to call from a background goroutine.
func (*Runner) PrepareAsync ¶
PrepareAsync creates the pending run DB record and emits the start audit event, then returns immediately. The caller is responsible for submitting the job to a worker (which calls ExecutePrepared). This lets the async endpoint return a run_id to the client before execution begins.
func (*Runner) SetCheckpointHook ¶ added in v0.3.1
func (r *Runner) SetCheckpointHook(hook CheckpointHook)
SetCheckpointHook sets a hook for automatic checkpoint creation after command execution