Documentation
¶
Overview ¶
Package plugins contains application-composition registration for all providers compiled into this binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveStorage ¶
func ResolveStorage( ctx context.Context, host *plugin.Host, selections StorageSelections, deps StorageDependencies, ) (database.Stores, error)
ResolveStorage starts the selected storage providers in dependency order. The supplied host owns their lifecycle; callers must stop it if resolution fails after one provider has started.
Types ¶
type DatabaseRuntime ¶
type DatabaseRuntime struct {
Database *database.Database
Host *plugin.Host
// contains filtered or unexported fields
}
DatabaseRuntime is a composed database plus the plugin host that owns its injected stores. Close preserves database-before-store shutdown ordering.
func OpenDatabase ¶
func OpenDatabase( ctx context.Context, dbConfig *database.Config, selections StorageSelections, deps StorageDependencies, ) (*DatabaseRuntime, error)
OpenDatabase explicitly composes a fresh host, storage providers, and a database. A non-nil error is returned only after all started resources have been stopped. Recoverable database initialization errors are exposed through DatabaseRuntime.RecoveryError on the successfully owned runtime.
func (*DatabaseRuntime) Close ¶
func (r *DatabaseRuntime) Close(ctx context.Context) error
Close stops database-owned resources before provider-owned stores.
func (*DatabaseRuntime) RecoveryError ¶
func (r *DatabaseRuntime) RecoveryError() error
RecoveryError reports a recoverable error encountered while opening the database. OpenDatabase returns these errors on the owned runtime instead of as its error result, so a non-nil returned error always means there is no live runtime for the caller to close.
type StorageDependencies ¶
type StorageDependencies struct {
DataDir string
RunMode string
StorageMode string
MaxConnections int
Logger *slog.Logger
PromRegistry prometheus.Registerer
}
StorageDependencies contains shared application settings injected into storage providers. These settings are deliberately not provider config.