plugin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoPluginLoader

type GoPluginLoader struct{}

GoPluginLoader loads Go plugins (.so files) on Linux/macOS

func (*GoPluginLoader) Load

Load loads a Go plugin from the given .so file The plugin must export a "NewFactory" variable of type func() domain.DataSourceFactory

func (*GoPluginLoader) SupportedExtension

func (l *GoPluginLoader) SupportedExtension() string

SupportedExtension returns ".so"

type PluginInfo

type PluginInfo struct {
	Type        domain.DataSourceType `json:"type"`
	Version     string                `json:"version"`
	Description string                `json:"description"`
	FilePath    string                `json:"file_path"`
}

PluginInfo contains metadata about a loaded plugin

type PluginLoader

type PluginLoader interface {
	// Load loads a plugin from the given file path
	// Returns a DataSourceFactory, plugin metadata, and any error
	Load(path string) (domain.DataSourceFactory, PluginInfo, error)

	// SupportedExtension returns the file extension this loader handles (e.g., ".so", ".dll")
	SupportedExtension() string
}

PluginLoader is the interface for loading plugins from shared library files Platform-specific implementations handle .so (Go plugin) or .dll (Windows DLL)

type PluginManager

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

PluginManager manages the lifecycle of datasource plugins

func NewPluginManager

func NewPluginManager(registry *application.Registry, dsManager *application.DataSourceManager, configDir string) *PluginManager

NewPluginManager creates a new plugin manager

func (*PluginManager) GetLoadedPlugins

func (pm *PluginManager) GetLoadedPlugins() []PluginInfo

GetLoadedPlugins returns the list of loaded plugins

func (*PluginManager) LoadPlugin

func (pm *PluginManager) LoadPlugin(path string) error

LoadPlugin loads a single plugin file

func (*PluginManager) ScanAndLoad

func (pm *PluginManager) ScanAndLoad(pluginDir string) error

ScanAndLoad scans the plugin directory and loads all compatible plugins

type PluginRequest

type PluginRequest struct {
	Method string                 `json:"method"`
	ID     string                 `json:"id,omitempty"`
	Params map[string]interface{} `json:"params,omitempty"`
}

PluginRequest is the JSON-RPC request format for DLL plugins

type PluginResponse

type PluginResponse struct {
	Result interface{} `json:"result,omitempty"`
	Error  string      `json:"error,omitempty"`
}

PluginResponse is the JSON-RPC response format from DLL plugins

Jump to

Keyboard shortcuts

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