Documentation
¶
Index ¶
Constants ¶
View Source
const (
TypeCloudProvider = "cloud-provider"
)
Plugin types
Variables ¶
View Source
var Registry = NewPluginRegistry()
Global registry instance
Functions ¶
func LoadExternalPlugins ¶
LoadExternalPlugins loads plugins from the specified directory and registers them
Types ¶
type ExternalPlugin ¶
type ExternalPlugin struct {
// contains filtered or unexported fields
}
ExternalPlugin provides access to dynamically loaded Go plugins
func LoadPluginFromFile ¶
func LoadPluginFromFile(path string) (*ExternalPlugin, error)
LoadPluginFromFile loads a plugin from a Go plugin file (.so)
type Plugin ¶
type Plugin interface {
// Info returns plugin metadata
Info() PluginInfo
// Init initializes the plugin with configuration
Init(config interface{}) error
// Start starts the plugin
Start() error
// Stop gracefully stops the plugin
Stop() error
// IsRunning returns true if the plugin is running
IsRunning() bool
}
Plugin defines the base interface all plugins must implement
func LoadPluginsFromDir ¶
LoadPluginsFromDir loads all plugins from a directory
func LoadPluginsFromManifest ¶
LoadPluginsFromManifest loads plugins based on manifest files
type PluginInfo ¶
type PluginInfo struct {
ID string // Unique identifier
Name string // Human-readable name
Type string // Plugin type (e.g., "cloud-provider")
Version string // Version string
Capabilities map[string]bool // Capabilities this plugin supports
Author string // Plugin author
Website string // Plugin website or repository
Dependencies []string // IDs of plugins this plugin depends on
}
PluginInfo contains metadata about a plugin
type PluginRegistry ¶
type PluginRegistry struct {
// contains filtered or unexported fields
}
PluginRegistry is the global registry of plugins
func NewPluginRegistry ¶
func NewPluginRegistry() *PluginRegistry
NewPluginRegistry creates a new plugin registry
func (*PluginRegistry) Get ¶
func (r *PluginRegistry) Get(id string) (Plugin, bool)
Get returns a plugin by ID
func (*PluginRegistry) GetByType ¶
func (r *PluginRegistry) GetByType(pluginType string) []Plugin
GetByType returns all plugins of a specific type
func (*PluginRegistry) Register ¶
func (r *PluginRegistry) Register(p Plugin) error
Register adds a plugin to the registry
Click to show internal directories.
Click to hide internal directories.