Documentation
¶
Overview ¶
Package temporal provides a backend that treats snippet execution as a Temporal workflow/activity. Useful for long-running or resumable executions. Note: Temporal is orchestration, not isolation - must compose with sandbox backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTemporalNotAvailable is returned when Temporal is not available. ErrTemporalNotAvailable = errors.New("temporal not available") // ErrWorkflowCreationFailed is returned when workflow creation fails. ErrWorkflowCreationFailed = errors.New("workflow creation failed") // ErrWorkflowExecutionFailed is returned when workflow execution fails. ErrWorkflowExecutionFailed = errors.New("workflow execution failed") // ErrMissingSandboxBackend is returned when no sandbox backend is configured. ErrMissingSandboxBackend = errors.New("temporal backend requires a sandbox backend for isolation") )
Errors for Temporal backend operations.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend executes code as Temporal workflows/activities.
func (*Backend) Execute ¶
func (b *Backend) Execute(_ context.Context, req runtime.ExecuteRequest) (runtime.ExecuteResult, error)
Execute runs code as a Temporal workflow. The actual code execution is delegated to the configured sandbox backend.
func (*Backend) Kind ¶
func (b *Backend) Kind() runtime.BackendKind
Kind returns the backend kind identifier.
type Config ¶
type Config struct {
// HostPort is the Temporal server address.
// Default: localhost:7233
HostPort string
// Namespace is the Temporal namespace.
// Default: default
Namespace string
// TaskQueue is the task queue for execution activities.
// Default: toolruntime-execution
TaskQueue string
// SandboxBackend is the backend used for actual code execution.
// Temporal provides orchestration; this backend provides isolation.
// Required for secure execution.
SandboxBackend runtime.Backend
// WorkflowIDPrefix is the prefix for workflow IDs.
// Default: toolruntime-
WorkflowIDPrefix string
// Logger is an optional logger for backend events.
Logger Logger
}
Config configures a Temporal backend.
Click to show internal directories.
Click to hide internal directories.