Documentation
¶
Index ¶
- type Engine
- func (e *Engine) CompileAndCache(siteID string, deployKey string, source string) ([]byte, error)
- func (e *Engine) EnsureSource(siteID string, deployKey string) error
- func (e *Engine) Execute(siteID string, deployKey string, env *core.Env, req *core.WorkerRequest) (result *core.WorkerResult)
- func (e *Engine) ExecuteFunction(siteID string, deployKey string, env *core.Env, fnName string, args ...any) (result *core.WorkerResult)
- func (e *Engine) ExecuteScheduled(siteID string, deployKey string, env *core.Env, cron string) (result *core.WorkerResult)
- func (e *Engine) ExecuteTail(siteID string, deployKey string, env *core.Env, events []core.TailEvent) (result *core.WorkerResult)
- func (e *Engine) InvalidatePool(siteID string, deployKey string)
- func (e *Engine) MaxResponseBytes() int
- func (e *Engine) SetDispatcher(d core.WorkerDispatcher)
- func (e *Engine) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine manages per-site worker pools and executes JS worker scripts using the QuickJS engine.
func NewEngine ¶
func NewEngine(cfg core.EngineConfig, sourceLoader core.SourceLoader) *Engine
NewEngine creates an Engine with the given configuration and source loader.
func (*Engine) CompileAndCache ¶
CompileAndCache validates that a worker script compiles and stores the source.
func (*Engine) EnsureSource ¶
EnsureSource loads the worker JS source into memory if not already cached.
func (*Engine) Execute ¶
func (e *Engine) Execute(siteID string, deployKey string, env *core.Env, req *core.WorkerRequest) (result *core.WorkerResult)
Execute runs the worker's fetch handler for the given request.
func (*Engine) ExecuteFunction ¶
func (e *Engine) ExecuteFunction(siteID string, deployKey string, env *core.Env, fnName string, args ...any) (result *core.WorkerResult)
ExecuteFunction calls an arbitrary named function on the worker module.
func (*Engine) ExecuteScheduled ¶
func (e *Engine) ExecuteScheduled(siteID string, deployKey string, env *core.Env, cron string) (result *core.WorkerResult)
ExecuteScheduled runs the worker's scheduled handler.
func (*Engine) ExecuteTail ¶
func (e *Engine) ExecuteTail(siteID string, deployKey string, env *core.Env, events []core.TailEvent) (result *core.WorkerResult)
ExecuteTail runs the worker's tail handler for log forwarding.
func (*Engine) InvalidatePool ¶
InvalidatePool marks the pool for the given site/deploy as invalid.
func (*Engine) MaxResponseBytes ¶
MaxResponseBytes returns the configured maximum response body size.
func (*Engine) SetDispatcher ¶
func (e *Engine) SetDispatcher(d core.WorkerDispatcher)
SetDispatcher sets the worker dispatcher for service binding support.