Versions in this module Expand all Collapse all v0 v0.2.0 Aug 10, 2026 Changes in this version + const RedactedPlaceholder + var DefaultOfficialPublicKey = "" + var OfficialPublicKeys = map[string]ed25519.PublicKey + func DownloadWASM(ctx context.Context, url string) ([]byte, error) + func InitAll(ctx context.Context, env *Environment, plugins []*LoadedPlugin) + func LimitClause(placeholder string, d Dialect) string + func MustRegisterOfficialPublicKey(keyID, pubKeyHex string) + func QuoteIdent(name string, d Dialect) string + func Rebind(query string, d Dialect) string + func Register(info PluginInfo, ctor func() Plugin) + func RegisterOfficialPublicKey(keyID, pubKeyHex string) error + func RegisterPluginTables(ctx context.Context, db *sql.DB, pluginName string, tableNames []string) error + func RunMigrations(ctx context.Context, db *sql.DB, dialect Dialect, coreMigrations []Migration, ...) error + func ValidateCapabilities(declared, limits CapabilityLimits) error + func ValidateManifest(m *Manifest) error + func VerifyChecksum(data []byte, expectedChecksum string) error + func VerifyManifestSignature(m *Manifest, allowUnsigned bool) error + func VerifyWasmSignature(wasmBytes []byte, iv *IndexVersion, pluginName string, allowUnsigned bool) error + func WithCallContext(ctx context.Context, cc *CallContext) context.Context + type AuditLogger interface + CapabilityChange func(ctx context.Context, pluginName, pluginVersion, details string) error + Deploy func(ctx context.Context, pluginName, pluginVersion string) error + Deprecate func(ctx context.Context, pluginName, pluginVersion string) error + EnforceRetention func(ctx context.Context, policy any) (int64, error) + Invocation func(ctx context.Context, pluginName, functionName string, dropRate float64) error + type CallContext struct + DB *sql.DB + TenantID string + WorkflowID string + func CallContextFromContext(ctx context.Context) *CallContext + type Capabilities struct + BackgroundWorker bool + CallPlugin []string + Database bool + HTTPMiddleware bool + HTTPRoutes bool + SignalWorkflow bool + StartWorkflow bool + func DefaultCapabilities() Capabilities + type CapabilityLimits struct + BackgroundWorker bool + CallPlugin []string + Database DatabaseAccess + HTTPMiddleware bool + HTTPRoutes bool + SignalWorkflow bool + StartWorkflow bool + func DefaultLimits() CapabilityLimits + func DeriveCapabilities(p Plugin) CapabilityLimits + func (l CapabilityLimits) IsSet() bool + type Command struct + Description string + Name string + Run func(args []string) error + type DatabaseAccess string + const DatabaseAccessNone + const DatabaseAccessReadOnly + const DatabaseAccessReadWrite + type Dialect string + const DialectMSSQL + const DialectMySQL + const DialectPostgres + type Environment struct + Audit *AuditLogger + Config []byte + DB PluginDB + Dialect Dialect + Done <-chan struct{} + Logger *slog.Logger + Mux ServeMux + SignalWorkflow func(ctx context.Context, workflowID, signalName, payload string) error + StartWorkflow func(ctx context.Context, defName string, input json.RawMessage) (runID string, err error) + TenantID string + type FieldDef struct + Description string + Fields map[string]FieldDef + Format string + Items *FieldDef + KeyType *FieldDef + Optional bool + Type string + ValueType *FieldDef + Values []string + type FuncOptions struct + Idempotent bool + Name string + type FuncRegistry interface + Register func(opts FuncOptions, fn PluginFunc) error + type HasBackground interface + Run func(ctx context.Context) error + type HasCommands interface + RegisterCommands func() []Command + type HasHealth interface + Health func() error + type HasHostFunctions interface + RegisterHostFunctions func(scope FuncRegistry) error + type HasMiddleware interface + Middleware func(next http.Handler) http.Handler + type HasMigrations interface + Migrations func() []Migration + type HasRoutes interface + RegisterRoutes func(mux *http.ServeMux) error + type HealthStatus struct + Error string + Healthy bool + Name string + type HostFuncDef struct + Description string + Idempotent bool + Input TypeDef + Output TypeDef + Streaming bool + type IndexEntry struct + Author string + Description string + Name string + Repository string + Versions []IndexVersion + func (e *IndexEntry) IsOfficial() bool + type IndexVersion struct + Bundled bool + Checksum string + Description string + ManifestURL string + MinCleatVersion string + Signature string + SigningKeyID string + Version string + WasmURL string + type JSONColumn struct + Raw json.RawMessage + func (j *JSONColumn) Scan(src any) error + func (j JSONColumn) Value() (driver.Value, error) + type LoadedPlugin struct + Error error + Healthy bool + Plugin Plugin + func Discover() ([]*LoadedPlugin, error) + func LoadAll(ctx context.Context, env *Environment) ([]*LoadedPlugin, error) + type Manifest struct + Author string + Capabilities Capabilities + Description string + HostFunctions map[string]HostFuncDef + MinCleatVersion string + Name string + Repository string + Signature string + SigningKeyID string + Types map[string]TypeDef + Version string + func LoadManifest(path string) (*Manifest, error) + func (m *Manifest) JSONBytes() ([]byte, error) + type Migration struct + Down string + Up string + UpMSSQL string + UpMySQL string + Version int + type PanicError struct + Plugin string + Stack string + Value any + func (e *PanicError) Error() string + func (e *PanicError) Unwrap() error + type Plugin interface + Info func() PluginInfo + Init func(ctx context.Context, env *Environment) error + type PluginDB interface + Begin func(ctx context.Context) (PluginTx, error) + Exec func(ctx context.Context, query string, args ...any) (int64, error) + Ping func(ctx context.Context) error + Query func(ctx context.Context, query string, args ...any) (Rows, error) + QueryRow func(ctx context.Context, query string, args ...any) RowScanner + type PluginFunc func(ctx context.Context, inputJSON string) (outputJSON string, err error) + func RecoverPluginFunc(pluginName string, tracker *PluginHealthTracker, fn PluginFunc) PluginFunc + type PluginHealthTracker struct + func NewPluginHealthTracker() *PluginHealthTracker + func (t *PluginHealthTracker) IsHealthy(pluginName string) bool + func (t *PluginHealthTracker) MarkHealthy(pluginName string) + func (t *PluginHealthTracker) MarkUnhealthy(pluginName string, err error) + func (t *PluginHealthTracker) UnhealthyError(pluginName string) error + func (t *PluginHealthTracker) UnhealthyStatus() []HealthStatus + type PluginIndex struct + Plugins []IndexEntry + func FetchIndex(ctx context.Context, urlStr string) (*PluginIndex, error) + func (idx *PluginIndex) Resolve(name, constraint string) (*IndexEntry, *IndexVersion, error) + type PluginInfo struct + Author string + DatabaseAccess DatabaseAccess + Description string + Name string + Requires []string + Version string + func List() []PluginInfo + type PluginStreamFunc func(ctx context.Context, inputJSON string) (<-chan StreamEvent, error) + func RecoverPluginStreamFunc(pluginName string, tracker *PluginHealthTracker, fn PluginStreamFunc) PluginStreamFunc + type PluginTx interface + Commit func() error + Exec func(ctx context.Context, query string, args ...any) (int64, error) + Query func(ctx context.Context, query string, args ...any) (Rows, error) + QueryRow func(ctx context.Context, query string, args ...any) RowScanner + Rollback func() error + type Query struct + Default string + MSSQL string + MySQL string + func (q Query) For(d Dialect) string + type RowScanner interface + Scan func(dest ...any) error + type Rows interface + Close func() error + Err func() error + Next func() bool + type Secret string + func (Secret) Format(f fmt.State, verb rune) + func (Secret) MarshalJSON() ([]byte, error) + func (Secret) String() string + func (s *Secret) Scan(src any) error + func (s *Secret) UnmarshalJSON(b []byte) error + func (s Secret) Reveal() string + func (s Secret) Value() (driver.Value, error) + type ServeMux = *http.ServeMux + type Stoppable interface + Stop func(ctx context.Context) error + type StreamEvent struct + Content string + Finish bool + Index int + type StreamFuncRegistry interface + RegisterStream func(opts FuncOptions, fn PluginStreamFunc) error + type TenantPools struct + OwnerDB *sql.DB + func NewTenantPools(ownerDB *sql.DB, baseDSN string, maxConns int) *TenantPools + func (tp *TenantPools) Close() + func (tp *TenantPools) EvictIdle(maxIdle time.Duration) int + func (tp *TenantPools) For(ctx context.Context, tenantID string) (*sql.DB, error) + type TypeDef struct + Fields map[string]FieldDef + Optional bool + Type string