plugins

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages the lifecycle of plugins.

func NewManager

func NewManager() *Manager

NewManager creates a new plugin manager.

func (*Manager) Get

func (m *Manager) Get(name string) *Plugin

Get returns a plugin by name, or nil if not found.

func (*Manager) List

func (m *Manager) List() []*Plugin

List returns all loaded plugins.

func (*Manager) Load

func (m *Manager) Load(config PluginConfig) (*Plugin, error)

Load reads a plugin manifest from the plugin directory and registers it. It expects a plugin.json file at the root of the plugin path.

func (*Manager) Unload

func (m *Manager) Unload(name string) error

Unload removes a plugin by name.

type Plugin

type Plugin struct {
	Name         string       `json:"name"`
	Path         string       `json:"path"`
	Config       PluginConfig `json:"config"`
	Loaded       bool         `json:"loaded"`
	Version      string       `json:"version,omitempty"`
	Description  string       `json:"description,omitempty"`
	Capabilities []string     `json:"capabilities,omitempty"`
}

Plugin represents a loaded plugin.

type PluginConfig

type PluginConfig struct {
	Type string `json:"type"` // "local"
	Path string `json:"path"`
}

PluginConfig describes how to load a plugin.

Jump to

Keyboard shortcuts

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