Help us shape the future of Go! Take the 2026 Go Developer Survey

plugin

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package plugin assembles explicitly linked Go extensions using the ordinary foundation registrar, typed feature APIs and managed application lifecycle.

Index

Constants

View Source
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

func MigrationOrigin(id ID) migrate.Origin

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 Dependency

type Dependency = manifest.Dependency

Dependency is a plugin manifest dependency.

type ID

type ID = manifest.ID

ID is a plugin manifest identifier.

type Manifest

type Manifest = manifest.Manifest

Manifest is a plugin's manifest declaration.

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.

func (Module) Boot

func (m Module) Boot(ctx context.Context, r *foundation.Runtime) error

Boot calls OnBoot when supplied; otherwise it succeeds.

func (Module) Manifest

func (m Module) Manifest() Manifest

Manifest returns a snapshot of the module's manifest.

func (Module) Register

func (m Module) Register(r *Registrar) error

Register calls OnRegister when supplied; otherwise it succeeds.

func (Module) Shutdown

func (m Module) Shutdown(ctx context.Context, r *foundation.Runtime) error

Shutdown calls OnShutdown when supplied; otherwise it succeeds.

type Plugin

type Plugin = foundation.Plugin

Plugin is the foundation plugin lifecycle contract.

type Registrar

type Registrar = foundation.Registrar

Registrar is the foundation declaration registrar.

type Requirement

type Requirement = manifest.Requirement

Requirement is a manifest version requirement.

type Version

type Version = manifest.Version

Version is a manifest release version.

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.

Jump to

Keyboard shortcuts

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