Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Disable(ctx context.Context, name string) error
- func (m *Manager) Enable(ctx context.Context, name string) error
- func (m *Manager) Get(name string) (Module, bool)
- func (m *Manager) List() []Module
- func (m *Manager) LoadModuleState(name string) (enabled bool, configJSON string, err error)
- func (m *Manager) Register(module Module) error
- func (m *Manager) RestoreModules(ctx context.Context, serverManager interface{}) error
- func (m *Manager) SaveModuleConfig(name string, config interface{}) error
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles registration and lifecycle of modules
func (*Manager) LoadModuleState ¶
LoadModuleState loads module state and config from database
func (*Manager) RestoreModules ¶
RestoreModules restores all enabled modules from database
func (*Manager) SaveModuleConfig ¶
SaveModuleConfig saves module configuration to database
type Module ¶
type Module interface {
// Name returns the unique identifier for this module
Name() string
// Description returns a human-readable description of what this module does
Description() string
// Enabled returns whether the module is currently enabled
Enabled() bool
// Enable starts the module and makes it active
// Dependencies can be passed via context values if needed
Enable(ctx context.Context) error
// Disable stops the module and makes it inactive
Disable(ctx context.Context) error
// GetConfig returns the current configuration for the module
GetConfig() interface{}
// SetConfig updates the module's configuration
SetConfig(config interface{}) error
// ValidateConfig validates the provided configuration
ValidateConfig(config interface{}) error
}
Module represents a pluggable module that can be enabled/disabled
Click to show internal directories.
Click to hide internal directories.