Documentation
¶
Index ¶
- type AlertPluginInterface
- type ExportPluginInterface
- type MetricPluginInterface
- type Plugin
- type PluginInfo
- type PluginManager
- func (m *PluginManager) DisablePlugin(name string) error
- func (m *PluginManager) EnablePlugin(name string) error
- func (m *PluginManager) GetPlugin(name string) (*Plugin, error)
- func (m *PluginManager) ListPlugins() []*Plugin
- func (m *PluginManager) ListPluginsByType(pluginType PluginType) []*Plugin
- func (m *PluginManager) LoadPlugin(path string) (*Plugin, error)
- func (m *PluginManager) UnloadPlugin(name string) error
- type PluginType
- type StoragePluginInterface
- type UIPluginInterface
- type ValidationPluginInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertPluginInterface ¶
type AlertPluginInterface interface {
// SendAlert sends an alert to a custom destination
SendAlert(alert any, options map[string]any) error
}
AlertPluginInterface defines the interface for alert plugins
type ExportPluginInterface ¶
type ExportPluginInterface interface {
// Export exports data to a custom format
Export(data any, options map[string]any) ([]byte, error)
}
ExportPluginInterface defines the interface for export plugins
type MetricPluginInterface ¶
type MetricPluginInterface interface {
// CollectMetrics collects custom metrics
CollectMetrics(options map[string]any) (map[string]any, error)
}
MetricPluginInterface defines the interface for metric plugins
type Plugin ¶
type Plugin struct {
Info PluginInfo `json:"info"`
Path string `json:"path"`
Module *plugin.Plugin `json:"-"`
Lookup map[string]any `json:"-"`
}
Plugin represents a loaded plugin
func (*Plugin) ExecuteFunc ¶
ExecuteFunc executes a function in a plugin
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
Type PluginType `json:"type"`
Enabled bool `json:"enabled"`
}
PluginInfo contains metadata about a plugin
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
PluginManager manages the loading and execution of plugins
func NewPluginManager ¶
func NewPluginManager() *PluginManager
NewPluginManager creates a new plugin manager
func (*PluginManager) DisablePlugin ¶
func (m *PluginManager) DisablePlugin(name string) error
DisablePlugin disables a plugin
func (*PluginManager) EnablePlugin ¶
func (m *PluginManager) EnablePlugin(name string) error
EnablePlugin enables a plugin
func (*PluginManager) GetPlugin ¶
func (m *PluginManager) GetPlugin(name string) (*Plugin, error)
GetPlugin returns a loaded plugin by name
func (*PluginManager) ListPlugins ¶
func (m *PluginManager) ListPlugins() []*Plugin
ListPlugins returns a list of all loaded plugins
func (*PluginManager) ListPluginsByType ¶
func (m *PluginManager) ListPluginsByType(pluginType PluginType) []*Plugin
ListPluginsByType returns a list of loaded plugins of a specific type
func (*PluginManager) LoadPlugin ¶
func (m *PluginManager) LoadPlugin(path string) (*Plugin, error)
LoadPlugin loads a plugin from a shared library file
func (*PluginManager) UnloadPlugin ¶
func (m *PluginManager) UnloadPlugin(name string) error
UnloadPlugin unloads a plugin
type PluginType ¶
type PluginType string
PluginType represents the type of plugin
const ( // ValidationPlugin is a plugin that provides custom validation rules ValidationPlugin PluginType = "validation" // AlertPlugin is a plugin that provides custom alerting mechanisms AlertPlugin PluginType = "alert" // MetricPlugin is a plugin that provides custom metrics collection MetricPlugin PluginType = "metric" // StoragePlugin is a plugin that provides custom storage backends StoragePlugin PluginType = "storage" // ExportPlugin is a plugin that provides custom export formats ExportPlugin PluginType = "export" // UIPlugin is a plugin that provides custom UI components UIPlugin PluginType = "ui" )
type StoragePluginInterface ¶
type StoragePluginInterface interface {
// Store stores data in a custom backend
Store(key string, data any, options map[string]any) error
// Retrieve retrieves data from a custom backend
Retrieve(key string, options map[string]any) (any, error)
}
StoragePluginInterface defines the interface for storage plugins