Versions in this module Expand all Collapse all v1 v1.8.5 Dec 3, 2026 v1.8.4 Dec 3, 2026 Changes in this version + var ErrHookExecutionFailed = errors.New("pluginhost: hook execution failed") + var ErrHookNotFound = errors.New("pluginhost: hook not found") + var ErrPluginInvalidFormat = errors.New("pluginhost: invalid WASM format") + var ErrPluginLoadFailed = errors.New("pluginhost: plugin load failed") + var ErrResourceLimitsExceeded = errors.New("pluginhost: plugin exceeded resource limits") + type Capabilities struct + Database []string + HTTP []string + RateLimit RateLimitConfig + type DBExecutor interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + QueryContext func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + type FailureMode int + const DefaultFailureMode + const FailFast + const Fallback + const LogAndContinue + func ParseFailureMode(s string) FailureMode + func (f FailureMode) String() string + type HookData struct + Content string + ContentID int + CustomFields map[string]any + PostType string + Status string + Tags []string + Title string + UserID int + type HookName string + const DefaultPriority + const HookAfterCreate + const HookAfterPublish + const HookAfterUnpublish + const HookBeforeDelete + const HookBeforeSave + const HookOnPluginLoaded + func (h HookName) String() string + type HookOptions struct + FailureMode FailureMode + Priority int + type HookResult struct + CustomFields map[string]any + Title *string + type HostConfig struct + DB DBExecutor + HTTPClient *http.Client + type Manifest struct + Capabilities Capabilities + MaxMemoryMB int + Name string + Version string + func ParseManifest(data []byte) (*Manifest, error) + func (m Manifest) HasDBPermission(perm string) bool + func (m Manifest) HasDatabase() bool + func (m Manifest) HasHTTP() bool + func (m Manifest) IsHTTPURLAllowed(url string) bool + func (m Manifest) Validate() error + type PluginInfo struct + Name string + Status string + type PluginSource struct + Manifest *Manifest + Name string + Wasm []byte + type RateLimitConfig struct + RequestsPerMinute int + type RuntimeConfig struct + CompilationCache wazero.CompilationCache + Logger func(string) + MaxExecutionTime time.Duration + MaxMemoryBytes uint64 + type System struct + func NewSystem(ctx context.Context, rtConfig RuntimeConfig, hostConfig HostConfig, ...) (*System, error) + func (s *System) Close(ctx context.Context) error + func (s *System) Execute(ctx context.Context, hook HookName, data []byte) ([]byte, error) + func (s *System) HasHook(hook HookName) bool + func (s *System) Plugins() []PluginInfo