manager

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package manager provides the PluginManager that orchestrates plugin discovery, loading, lifecycle, and hot-reload.

Package manager provides the PluginManager that orchestrates plugin discovery, loading, lifecycle, and hot-reload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginAdapters

type PluginAdapters struct {
	Module    *adapter.PluginModuleAdapter
	Abilities []*adapter.PluginAbilityAdapter
	Provider  *adapter.PluginProviderAdapter
}

PluginAdapters holds all adapters for a plugin instance.

type PluginConfig

type PluginConfig = plugintypes.PluginConfig

PluginConfig is a type alias for plugintypes.PluginConfig.

func DefaultPluginConfig

func DefaultPluginConfig() *PluginConfig

DefaultPluginConfig calls plugintypes.DefaultPluginConfig to maintain backward compatibility with existing callers.

type PluginInstance

type PluginInstance struct {
	Identity  string
	Manifest  *plugin.Manifest
	Runner    plugin.Runner
	Adapters  *PluginAdapters
	State     plugin.PluginState
	StartedAt time.Time
	LastError error
}

PluginInstance tracks a loaded plugin's state.

type PluginManager

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

PluginManager orchestrates plugin discovery, loading, lifecycle, and hot-reload.

func NewPluginManager

func NewPluginManager(cfg *PluginConfig, log zerolog.Logger) *PluginManager

NewPluginManager creates a PluginManager from configuration.

func (*PluginManager) Init

func (m *PluginManager) Init(ctx context.Context, pluginConfigs map[string]json.RawMessage) error

Init discovers and loads all plugins from configured sources.

func (*PluginManager) List

func (m *PluginManager) List() []*PluginInstance

List returns all loaded plugin instances.

func (*PluginManager) ReloadPlugin

func (m *PluginManager) ReloadPlugin(ctx context.Context, identity string, newManifest *plugin.Manifest, newCfg json.RawMessage) error

ReloadPlugin hot-reloads a plugin with validate-then-swap semantics.

func (*PluginManager) UnloadPlugin

func (m *PluginManager) UnloadPlugin(ctx context.Context, identity string) error

UnloadPlugin unloads a plugin and removes it from all registries.

type SourceConfig

type SourceConfig = plugintypes.SourceConfig

SourceConfig is a type alias for plugintypes.SourceConfig.

Jump to

Keyboard shortcuts

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