plugin

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

func NewLoader

func NewLoader(pluginsDir string) *Loader

func (*Loader) GetPlugin

func (l *Loader) GetPlugin(name string) (*Plugin, bool)

func (*Loader) ListPlugins

func (l *Loader) ListPlugins() []Plugin

func (*Loader) LoadPlugins

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

type Manager

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

Manager handles plugin discovery, validation, and registration

func NewManager

func NewManager() *Manager

NewManager creates a new plugin manager instance

func (*Manager) DiscoverAndLoad

func (m *Manager) DiscoverAndLoad(rootCmd *cobra.Command) error

DiscoverAndLoad finds and loads all plugins in the plugin directory

type Plugin

type Plugin struct {
	Path     string
	Metadata struct {
		Name        string `json:"name"`
		Version     string `json:"version"`
		Description string `json:"description"`
		Usage       string `json:"usage"`
		ExecPath    string `json:"exec_path,omitempty"`
		Checksum    string `json:"checksum,omitempty"`
	}
}

Plugin represents a loaded plugin with its metadata and execution path

type PluginMetadata

type PluginMetadata struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
	Usage       string `json:"usage"`
	ExecPath    string `json:"execPath,omitempty"`
	Checksum    string `json:"checksum,omitempty"`
	Signature   string `json:"signature,omitempty"`
}

PluginMetadata represents the JSON structure that plugins must output when called with --describe

Jump to

Keyboard shortcuts

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