Documentation
¶
Overview ¶
Package plugin assembles explicitly linked Go extensions using the ordinary foundation registrar, typed feature APIs and managed application lifecycle.
Index ¶
- Constants
- func LoadConfig[T any](declaration Manifest, schema *config.Schema[T], defaults T, ...) (T, config.Report, error)
- func MigrationOrigin(id ID) migrate.Origin
- func Provider(id ID) foundation.ProviderID
- func RegisterMigrationRegistry(r *Registrar, key foundation.Key[*migrate.Registry], ...) error
- func RegisterMigrations(r *Registrar, key foundation.Key[*migrate.Registry], ...) error
- type Dependency
- type ID
- type Manifest
- type Module
- type Plugin
- type Registrar
- type Requirement
- type Version
Constants ¶
const FrameworkVersion = manifest.FrameworkVersion
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig[T any](declaration Manifest, schema *config.Schema[T], defaults T, inputs config.Inputs[T]) (T, config.Report, error)
LoadConfig uses the existing typed configuration loader: owned defaults, ordered files, environment, then explicit application overrides. Every field must remain in this manifest's exact namespace. Unknown file/override keys still fail. Return the error from the plugin constructor before registration. The report contains provenance, never configuration values.
func MigrationOrigin ¶
MigrationOrigin is stable across plugin releases. Individual definitions keep the release that introduced them, rather than the currently installed version.
func Provider ¶
func Provider(id ID) foundation.ProviderID
Provider returns the foundation provider identifier for a plugin.
func RegisterMigrationRegistry ¶
func RegisterMigrationRegistry(r *Registrar, key foundation.Key[*migrate.Registry], definitions ...migrate.Definition) error
RegisterMigrationRegistry combines explicit app/framework history with plugin history through migrate.New, preserving its checksum and dependency semantics. Resolve the registry for an explicit migrate runner; it never runs implicitly.
func RegisterMigrations ¶
func RegisterMigrations(r *Registrar, key foundation.Key[*migrate.Registry], definitions ...migrate.Definition) error
RegisterMigrations snapshots historical SQL and dependencies under this plugin's origin. An omitted origin is filled; a foreign origin is rejected. Version is the full semantic release that introduced each migration and must not exceed the captured installed version. No database I/O runs here or on boot.
Types ¶
type Module ¶
type Module struct {
Declaration Manifest
OnRegister func(*Registrar) error
OnBoot func(context.Context, *foundation.Runtime) error
OnShutdown func(context.Context, *foundation.Runtime) error
}
Module adapts optional callbacks to a plugin. Configuration belongs to the constructor's typed values; callbacks must not mutate shared module globals.
type Registrar ¶
type Registrar = foundation.Registrar
Registrar is the foundation declaration registrar.
type Requirement ¶
type Requirement = manifest.Requirement
Requirement is a manifest version requirement.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package assets distributes immutable plugin files through Foundry's shared guarded publisher.
|
Package assets distributes immutable plugin files through Foundry's shared guarded publisher. |
|
Package manifest contains plugin declarations without importing application assembly or concrete features.
|
Package manifest contains plugin declarations without importing application assembly or concrete features. |
|
Package scaffold distributes typed plugin scaffold renderers.
|
Package scaffold distributes typed plugin scaffold renderers. |