Documentation
¶
Overview ¶
Package pluginkit provides compile-time plugin infrastructure: a lifecycle contract, a plugin host, and route guarding for plugin namespaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host starts and stops a fixed set of plugins.
func (*Host) PublicPaths ¶
PublicPaths returns the session-exempt paths of every PublicPathProvider plugin, keyed by plugin ID.
func (*Host) Routes ¶
Routes returns the HTTP handler of every RouteProvider plugin, keyed by plugin ID.
func (*Host) Seed ¶ added in v0.3.0
Seed asks every Seeder plugin to fill its schema in registration order, stopping at the first failure.
type Migrator ¶
Migrator is implemented by plugins that own database schema, which the host migrates before starting any plugin.
type Plugin ¶
type Plugin interface {
ID() string
Start(ctx context.Context) error
Stop(ctx context.Context) error
}
Plugin is an independently addable unit of functionality with a managed lifecycle.
type PublicPathProvider ¶
type PublicPathProvider interface {
PublicPaths() []string
}
PublicPathProvider is implemented by plugins declaring namespace-relative paths that must stay reachable without a session. Paths match exactly, for every HTTP method, and all else stays protected.
type RouteProvider ¶
RouteProvider is implemented by plugins that expose HTTP endpoints under their own namespace.
Directories
¶
| Path | Synopsis |
|---|---|
|
graphwire
module
|
|
|
Package wire generates an application's plugin wiring files from the plugin.json manifest of every directory under each configured plugin root.
|
Package wire generates an application's plugin wiring files from the plugin.json manifest of every directory under each configured plugin root. |