plugin

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRegistrar

type CommandRegistrar interface {
	Commands() []*cobra.Command
}

CommandRegistrar is implemented by plugins that add CLI commands.

type EventRegistrar

type EventRegistrar interface {
	RegisterEvents(d *events.Dispatcher)
}

EventRegistrar is implemented by plugins that listen to framework events.

type Plugin

type Plugin interface {
	container.Provider

	// Name returns a unique identifier for the plugin (e.g., "notifications").
	Name() string
}

Plugin is a self-contained module that integrates with the RapidGo framework. It embeds container.Provider for service registration (Register + Boot).

type PluginManager

type PluginManager struct {
	// contains filtered or unexported fields
}

PluginManager coordinates plugin registration and subsystem wiring.

func NewManager

func NewManager() *PluginManager

NewManager creates a PluginManager.

func (*PluginManager) Add

func (m *PluginManager) Add(p Plugin) error

Add registers a plugin. Returns an error if a plugin with the same Name() is already registered.

func (*PluginManager) BootAll

func (m *PluginManager) BootAll(c *container.Container)

BootAll calls Boot(c) on each plugin in registration order.

func (*PluginManager) Plugins

func (m *PluginManager) Plugins() []Plugin

Plugins returns all registered plugins.

func (*PluginManager) RegisterAll

func (m *PluginManager) RegisterAll(c *container.Container)

RegisterAll calls Register(c) on each plugin in registration order.

func (*PluginManager) RegisterCommands

func (m *PluginManager) RegisterCommands(root *cobra.Command)

RegisterCommands calls Commands() on each plugin that implements CommandRegistrar and adds the returned commands to the root Cobra command.

func (*PluginManager) RegisterEvents

func (m *PluginManager) RegisterEvents(d *events.Dispatcher)

RegisterEvents calls RegisterEvents(d) on each plugin that implements EventRegistrar.

func (*PluginManager) RegisterRoutes

func (m *PluginManager) RegisterRoutes(r *router.Router)

RegisterRoutes calls RegisterRoutes(r) on each plugin that implements RouteRegistrar.

type RouteRegistrar

type RouteRegistrar interface {
	RegisterRoutes(r *router.Router)
}

RouteRegistrar is implemented by plugins that register HTTP routes.

Jump to

Keyboard shortcuts

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