Documentation
¶
Index ¶
- Constants
- type DecoderPlugin
- type Factory
- type Loader
- type Manager
- func (m *Manager) DecodeEvent(eventType string, data []byte) (json.RawMessage, error)
- func (m *Manager) DecodeEventWithPlugin(pluginName string, eventType string, data []byte) (json.RawMessage, error)
- func (m *Manager) GetPlugin(name string) (DecoderPlugin, bool)
- func (m *Manager) GetPlugins() []Metadata
- func (m *Manager) Initialize() error
- type Metadata
- type Registry
- func (r *Registry) Clear()
- func (r *Registry) Decode(pluginName string, eventType string, data []byte) (json.RawMessage, error)
- func (r *Registry) FindAndDecode(eventType string, data []byte) (json.RawMessage, string, error)
- func (r *Registry) ListPlugins() []Metadata
- func (r *Registry) LoadFromDirectory(dir string) error
Constants ¶
const FactorySymbol = "NewPluginFactory"
FactorySymbol is the exported symbol name for dynamic loading
const Version = "1.0.0"
Version is the semantic versioning for the plugin API
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecoderPlugin ¶
type DecoderPlugin interface {
// Name returns the plugin identifier
Name() string
// Version returns the plugin version following semver
Version() string
// CanDecode returns true if this plugin can handle the given event
CanDecode(eventType string) bool
// Decode processes the event and returns decoded data
Decode(data []byte) (json.RawMessage, error)
// Metadata returns plugin capabilities and requirements
Metadata() Metadata
}
DecoderPlugin defines the interface for custom decoder plugins
type Factory ¶
type Factory interface {
Create() (DecoderPlugin, error)
}
Factory creates a plugin instance
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader manages plugin discovery and initialization
func (*Loader) FindForEvent ¶
func (l *Loader) FindForEvent(eventType string) (DecoderPlugin, bool)
FindForEvent returns the first plugin that can decode the event type
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates plugin operations with the main decoder system
func NewManager ¶
NewManager creates a plugin manager with an optional base directory
func (*Manager) DecodeEvent ¶
DecodeEvent decodes using the most appropriate plugin
func (*Manager) DecodeEventWithPlugin ¶
func (m *Manager) DecodeEventWithPlugin(pluginName string, eventType string, data []byte) (json.RawMessage, error)
DecodeEventWithPlugin uses a specific plugin
func (*Manager) GetPlugin ¶
func (m *Manager) GetPlugin(name string) (DecoderPlugin, bool)
GetPlugin retrieves a specific plugin
func (*Manager) GetPlugins ¶
GetPlugins returns available plugins
func (*Manager) Initialize ¶
Initialize loads plugins from the plugins directory
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
Version string `json:"version"`
APIVersion string `json:"api_version"`
EventTypes []string `json:"event_types"`
Description string `json:"description"`
}
Metadata describes plugin capabilities
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the plugin ecosystem with isolation and versioning
func (*Registry) Decode ¶
func (r *Registry) Decode(pluginName string, eventType string, data []byte) (json.RawMessage, error)
Decode uses a plugin to decode an event
func (*Registry) FindAndDecode ¶
FindAndDecode searches for a capable plugin and decodes the event
func (*Registry) ListPlugins ¶
ListPlugins returns information about all loaded plugins
func (*Registry) LoadFromDirectory ¶
LoadFromDirectory scans and loads all plugins from a directory