Documentation
¶
Overview ¶
Package runner provides the execution interface for running functions. Supports multiple event types with type-specific responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnhanceError ¶
EnhanceError transforms a raw Lua error into a user-friendly error message with code context and actionable suggestions.
The enhanced error includes:
- The original error message with line number
- Code snippet showing surrounding lines with the error line highlighted
- A column indicator (^) when column information is available
- Pattern-matched suggestions for common Lua errors
Returns nil if err is nil. If line number cannot be extracted from the error, only the error message and suggestion (if applicable) are included.
Types ¶
type Dependencies ¶
type Dependencies struct {
Logger logger.Logger
KV kv.Store
Env env.Store
HTTP internalhttp.Client
AI ai.Client
AITracker ai.Tracker
Email email.Client
EmailTracker email.Tracker
Timeout time.Duration // Execution timeout (defaults to 5 minutes if not set)
}
Dependencies holds all the dependencies needed to run a Lua function
type LuaRuntime ¶
type LuaRuntime struct {
// contains filtered or unexported fields
}
LuaRuntime implements the engine.Runtime interface for Lua code execution.
func NewLuaRuntime ¶
func NewLuaRuntime(cfg LuaRuntimeConfig) *LuaRuntime
NewLuaRuntime creates a new LuaRuntime with the given configuration.
func (*LuaRuntime) Execute ¶
func (r *LuaRuntime) Execute(ctx context.Context, req engine.RuntimeRequest) (*engine.RuntimeResult, error)
Execute implements the engine.Runtime interface.
type LuaRuntimeConfig ¶
type LuaRuntimeConfig struct {
Logger logger.Logger
KV kv.Store
Env env.Store
HTTP internalhttp.Client
AI ai.Client
AITracker ai.Tracker
Email email.Client
EmailTracker email.Tracker
Timeout time.Duration
}
LuaRuntimeConfig holds the configuration for creating a LuaRuntime.
type Request ¶
type Request struct {
Context *events.ExecutionContext
Event events.Event
Code string
}
Request represents a function execution request