Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigKeyDependencies = "__dependencies" ConfigKeyVersion = "__version" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶ added in v0.3.2
type Command interface {
Name() string
Description() string
Run(ctx *CommandContext) *CommandResult
}
type CommandContext ¶ added in v0.3.2
type CommandProvider ¶ added in v0.3.2
type CommandProvider interface {
Commands() []Command
}
type CommandResult ¶ added in v0.3.2
type EndpointSetup ¶
type MigrationProvider ¶ added in v0.4.0
type MigrationProvider interface {
// MigrationSource returns a migration source for this plugin
// The source name should match the plugin name
// Returns any to avoid circular dependency with migrations package
// Actual type should be migrations.MigrationSource
MigrationSource() any
// MigrationDependencies returns list of sources this plugin depends on
// Example: ["app", "users-plugin"]
// Ensures migrations run in correct order
// Return nil or empty slice if no dependencies
MigrationDependencies() []string
}
type OpenAPIProvider ¶ added in v0.4.8
type OpenAPIProvider interface {
GetOpenAPIResources() []OpenAPIResource
}
type OpenAPIResource ¶ added in v0.4.8
type PluginDependencies ¶ added in v0.4.5
type PluginDependencies interface {
Dependencies() []string
}
PluginDependencies is an optional interface for plugins that depend on other plugins. Dependencies must be declared by their plugin name (matching Plugin.Name()). The plugin loader ensures:
- All dependencies are registered and enabled
- Dependencies are initialized before dependent plugins
- Circular dependencies are detected and rejected
- Dependencies are injected via Initialize() config under ConfigKeyDependencies
type PluginRegistry ¶
type PluginRegistry struct {
// contains filtered or unexported fields
}
Plugins are NOT automatically applied; user must explicitly call plugin.Handler() and register it.
func NewPluginRegistry ¶
func NewPluginRegistry() *PluginRegistry
func (*PluginRegistry) GetAll ¶
func (r *PluginRegistry) GetAll() map[string]Plugin
func (*PluginRegistry) Register ¶
func (r *PluginRegistry) Register(plugin Plugin)
Click to show internal directories.
Click to hide internal directories.