Versions in this module Expand all Collapse all v0 v0.2.0 Sep 16, 2026 Changes in this version type Host + func (h *Host) Running() []plugin.Manifest v0.1.0 Sep 14, 2026 Changes in this version + const CookiePrefix + const DefaultCallTimeout + const DefaultEventTimeout + const DefaultMaxRestarts + const DefaultRestartBackoff + const DefaultStartTimeout + const MaxRestartBackoff + const MaxServeHeaders + const MaxServeRequestBytes + const MaxServeResponseBytes + const ServeTimeout + const SettingDailyCap + var ErrClosed = errors.New("plugins: the plugin host is closed") + var ErrNoDataKey = errors.New("plugins: the server has no data key, so a plugin database cannot be created") + var ErrNoPlugin = errors.New("plugins: no plugin of that name is installed") + var ErrNoRoute = errors.New("plugins: this plugin does not serve a route") + var ErrOverCap = errors.New("plugins: the daily token cap has been reached") + var ErrUnavailable = errors.New("plugins: the plugin is not running") + func Reserved(name string) bool + type Host struct + func New(opts Options) (*Host, error) + func (h *Host) Access(name, path string) (plugin.Access, bool) + func (h *Host) All(ctx context.Context) ([]Status, error) + func (h *Host) Answering(kind plugin.RequestKind) []string + func (h *Host) Ask(ctx context.Context, name string, r plugin.Request) (plugin.Response, error) + func (h *Host) Close() + func (h *Host) DailyCap(ctx context.Context, name string) (int64, error) + func (h *Host) Disable(ctx context.Context, name string) error + func (h *Host) Discover(ctx context.Context) error + func (h *Host) Enable(ctx context.Context, name string) error + func (h *Host) InterfaceVersion() int + func (h *Host) List() []Status + func (h *Host) Notify(ctx context.Context, e plugin.Event) + func (h *Host) Remove(ctx context.Context, name string) error + func (h *Host) Restart(ctx context.Context, name string) error + func (h *Host) Serve(ctx context.Context, name string, r plugin.HTTPRequest) (plugin.HTTPResponse, error) + func (h *Host) SetDailyCap(ctx context.Context, name string, tokens int64) error + func (h *Host) Spending(ctx context.Context, name string) (Spending, error) + func (h *Host) Status(ctx context.Context, name string) (Status, error) + type Options struct + CallTimeout time.Duration + Dir string + EventTimeout time.Duration + Keyring *auth.Keyring + Log *slog.Logger + MaxRestarts int + Now func() time.Time + RestartBackoff time.Duration + StartTimeout time.Duration + Store Store + type Spending struct + Cap int64 + Month db.TokenUse + OverCap bool + Today db.TokenUse + type State string + const StateDisabled + const StateDiscovered + const StateFailed + const StateRunning + const StateStarting + const StateStopped + type Status struct + Author string + Capabilities plugin.Capabilities + Description string + Enabled bool + Installed bool + InterfaceVersion int + LastError string + LastOutput string + Name string + Restarts int + Settings []plugin.Setting + State State + Version string + type Store interface + ClearPluginDatabase func(ctx context.Context, name string) error + DeletePlugin func(ctx context.Context, name string) error + DropPluginDatabase func(ctx context.Context, name string) error + Plugin func(ctx context.Context, name string) (db.PluginRecord, error) + PluginDSN func(name, password string) (string, error) + PluginDatabase func(ctx context.Context, name string) (db.PluginDatabaseRow, error) + PluginSettings func(ctx context.Context, name string) ([]db.PluginSettingRow, error) + PluginTokensSince func(ctx context.Context, since time.Time) (db.TokenUse, error) + PluginTokensSinceFor func(ctx context.Context, name string, since time.Time) (db.TokenUse, error) + Plugins func(ctx context.Context) ([]db.PluginRecord, error) + ProvisionPluginDatabase func(ctx context.Context, name, password string) error + RecordPluginUsage func(ctx context.Context, u db.PluginUsageWrite) error + SavePlugin func(ctx context.Context, p db.PluginRecord) error + SavePluginDeclaredSettings func(ctx context.Context, name string, declared []byte) error + SavePluginEnabled func(ctx context.Context, name string, enabled bool) error + SavePluginSetting func(ctx context.Context, plugin, name, value string) error + SavePluginState func(ctx context.Context, name, state, lastError, lastOutput string, restarts int) error + SetPluginProvisioned func(ctx context.Context, name string, sealed []byte, migration string) error