loader

package
v0.0.0-...-14802c6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 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 LoadedPlugin

type LoadedPlugin struct {
	Plugin   pkgplugin.Plugin
	Handle   *goplugin.Plugin
	Path     string
	Metadata *pkgplugin.PluginMetadata
	LoadedAt time.Time
}

LoadedPlugin represents a loaded .so plugin.

type Loader

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

Loader loads/unloads/manages external plugins from .so files.

func NewLoader

func NewLoader(dir string, mgr pkgplugin.Manager) *Loader

NewLoader creates a new plugin loader.

func (*Loader) GetAvailable

func (l *Loader) GetAvailable() ([]string, error)

GetAvailable returns .so files in the plugins dir that are NOT loaded.

func (*Loader) GetInstalled

func (l *Loader) GetInstalled() ([]string, error)

GetInstalled returns all .so files in the plugins dir.

func (*Loader) GetLoaded

func (l *Loader) GetLoaded() map[string]*LoadedPlugin

GetLoaded returns all currently loaded plugins.

func (*Loader) GetPluginDir

func (l *Loader) GetPluginDir() string

GetPluginDir returns the plugin directory path.

func (*Loader) Install

func (l *Loader) Install(ctx context.Context, name string) error

Install downloads a plugin .so from the registry and places it in the plugins dir.

func (*Loader) IsLoaded

func (l *Loader) IsLoaded(name string) bool

IsLoaded checks if a plugin is loaded.

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, path string) error

Load loads a single plugin from a .so file path.

func (*Loader) LoadAll

func (l *Loader) LoadAll(ctx context.Context) error

LoadAll loads all .so plugins from the plugins directory.

func (*Loader) LoadByName

func (l *Loader) LoadByName(ctx context.Context, name string) error

LoadByName loads a plugin by name from the plugins directory.

func (*Loader) Remove

func (l *Loader) Remove(ctx context.Context, name string) error

Remove deletes a plugin .so file from the plugins directory.

func (*Loader) SetRepoURL

func (l *Loader) SetRepoURL(url string)

SetRepoURL sets the plugin registry URL.

func (*Loader) Unload

func (l *Loader) Unload(ctx context.Context, name string) error

Unload unloads a plugin by name (stops it, unregisters commands, removes from manager).

Jump to

Keyboard shortcuts

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