Versions in this module Expand all Collapse all v1 v1.0.0 Feb 21, 2026 v0 v0.1.1 Feb 21, 2026 v0.1.0 Feb 21, 2026 Changes in this version + var DataDir = "./data" + func BundleWorkerScript(deployPath string) (string, error) + func EnsureUnenv(dataDir string) (string, error) + func ResetUnenvCache() + func ValidateCron(expr string) error + func ValidateDatabaseID(id string) error + type AssetsFetcher interface + Fetch func(req *WorkerRequest) (*WorkerResponse, error) + type CacheEntry struct + Body []byte + ExpiresAt *time.Time + Headers string + Status int + type CacheStore interface + Delete func(cacheName, url string) (bool, error) + Match func(cacheName, url string) (*CacheEntry, error) + Put func(cacheName, url string, status int, headers string, body []byte, ttl *int) error + type D1Bridge struct + DatabaseID string + func NewD1BridgeMemory(databaseID string) (*D1Bridge, error) + func OpenD1Database(dataDir, databaseID string) (*D1Bridge, error) + func (d *D1Bridge) Close() error + func (d *D1Bridge) Exec(sqlStr string, bindings []interface{}) (*D1ExecResult, error) + type D1ExecResult struct + Columns []string + Meta D1Meta + Rows [][]interface{} + type D1Meta struct + ChangedDB bool + Changes int64 + LastRowID int64 + RowsRead int + RowsWritten int + type DurableObjectStore interface + Delete func(namespace, objectID, key string) error + DeleteAll func(namespace, objectID string) error + DeleteMulti func(namespace, objectID string, keys []string) (int, error) + Get func(namespace, objectID, key string) (string, error) + GetMulti func(namespace, objectID string, keys []string) (map[string]string, error) + List func(namespace, objectID, prefix string, limit int, reverse bool) ([]KVPair, error) + Put func(namespace, objectID, key, valueJSON string) error + PutMulti func(namespace, objectID string, entries map[string]string) error + type Engine struct + func NewEngine(cfg EngineConfig, sourceLoader SourceLoader) *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 *Env, req *WorkerRequest) (result *WorkerResult) + func (e *Engine) ExecuteScheduled(siteID string, deployKey string, env *Env, cron string) (result *WorkerResult) + func (e *Engine) ExecuteTail(siteID string, deployKey string, env *Env, events []TailEvent) (result *WorkerResult) + func (e *Engine) InvalidatePool(siteID string, deployKey string) + func (e *Engine) MaxResponseBytes() int + func (e *Engine) Shutdown() + type EngineConfig struct + ExecutionTimeout int + FetchTimeoutSec int + MaxFetchRequests int + MaxResponseBytes int + MaxScriptSizeKB int + MemoryLimitMB int + PoolSize int + type Env struct + Assets AssetsFetcher + Cache CacheStore + D1Bindings map[string]string + D1DataDir string + Dispatcher WorkerDispatcher + DurableObjects map[string]DurableObjectStore + KV map[string]KVStore + Queues map[string]QueueSender + Secrets map[string]string + ServiceBindings map[string]ServiceBindingConfig + SiteID string + Storage map[string]R2Store + Vars map[string]string + type KVListResult struct + Cursor string + Keys []map[string]interface{} + ListComplete bool + type KVPair struct + Key string + Value string + type KVStore interface + Delete func(key string) error + Get func(key string) (string, error) + GetWithMetadata func(key string) (*KVValueWithMetadata, error) + List func(prefix string, limit int, cursor string) (*KVListResult, error) + Put func(key, value string, metadata *string, ttl *int) error + type KVValueWithMetadata struct + Metadata *string + Value string + type LogEntry struct + Level string + Message string + Time time.Time + type QueueMessageInput struct + Body string + ContentType string + type QueueSender interface + Send func(body, contentType string) (string, error) + SendBatch func(messages []QueueMessageInput) ([]string, error) + type R2ListOptions struct + Cursor string + Delimiter string + Limit int + Prefix string + type R2ListResult struct + Cursor string + DelimitedPrefixes []string + Objects []R2Object + Truncated bool + type R2Object struct + ContentType string + CustomMetadata map[string]string + ETag string + Key string + LastModified time.Time + Size int64 + type R2PutOptions struct + ContentType string + CustomMetadata map[string]string + type R2Store interface + Delete func(keys []string) error + Get func(key string) ([]byte, *R2Object, error) + Head func(key string) (*R2Object, error) + List func(opts R2ListOptions) (*R2ListResult, error) + PresignedGetURL func(key string, expiry time.Duration) (string, error) + PublicURL func(key string) (string, error) + Put func(key string, data []byte, opts R2PutOptions) (*R2Object, error) + type ServiceBindingBridge struct + Dispatcher WorkerDispatcher + Env *Env + func (sb *ServiceBindingBridge) Fetch(config ServiceBindingConfig, req *WorkerRequest) (*WorkerResponse, error) + type ServiceBindingConfig struct + TargetDeployKey string + TargetSiteID string + type SourceLoader interface + GetWorkerScript func(siteID, deployKey string) (string, error) + type TailEvent struct + Exceptions []string + Logs []LogEntry + Outcome string + ScriptName string + Timestamp time.Time + type WebSocketHandler struct + func (wsh *WebSocketHandler) Bridge(ctx context.Context, httpConn *websocket.Conn) + type WorkerDispatcher interface + Execute func(siteID, deployKey string, env *Env, req *WorkerRequest) *WorkerResult + type WorkerRequest struct + Body []byte + Headers map[string]string + Method string + URL string + type WorkerResponse struct + Body []byte + HasWebSocket bool + Headers map[string]string + StatusCode int + type WorkerResult struct + Duration time.Duration + Error error + Logs []LogEntry + Response *WorkerResponse + WebSocket *WebSocketHandler