plugin_registry

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClosePlugins

func ClosePlugins()

ClosePlugins closes all plugins in the global registry.

func GetPlugin

func GetPlugin(name string) (plugins.Plugin, error)

GetPlugin retrieves a plugin from the global registry by name.

func LoadPlugins

func LoadPlugins(dir string) error

LoadPlugins loads plugins from the specified directory into the global registry.

Types

type Registry

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

Registry holds a collection of all registered plugins. For gRPC plugins, it manages the go-plugin Clients.

var GlobalRegistry *Registry

GlobalRegistry is the global plugin registry.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new plugin registry.

func (*Registry) Close

func (r *Registry) Close()

Close kills all plugin clients.

func (*Registry) Get

func (r *Registry) Get(name string) (plugins.Plugin, bool)

Get retrieves a plugin from the registry by name.

func (*Registry) LoadPlugin

func (r *Registry) LoadPlugin(path string) error

LoadPlugin loads a single plugin from the given path.

func (*Registry) LoadPluginsFromDir

func (r *Registry) LoadPluginsFromDir(dir string) error

LoadPluginsFromDir scans the directory for plugin binaries and loads them.

func (*Registry) Register

func (r *Registry) Register(p plugins.Plugin)

Register adds a plugin instance directly to the registry. Useful for testing or in-process plugins.

Jump to

Keyboard shortcuts

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