plugins

package
v0.70.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

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 NewHost

func NewHost() (*plugin.Host, error)

NewHost constructs a host and explicitly registers all built-in providers.

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.

type StorageSelections

type StorageSelections struct {
	Blob     plugin.Selection
	Metadata plugin.Selection
}

StorageSelections identifies the providers and provider-owned configuration for the two storage capabilities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL