plugins

package
v0.0.0-...-6e3fede Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginConfig

type PluginConfig struct {
	// Path is the storage path of the plugin.
	Path string
	// ImportPath is the module path i.e. "github.com/user/module".
	ImportPath string
}

PluginConfig is the configuration of the plugin.

type PluginHost

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

PluginHost manages the plugins.

func NewPluginHost

func NewPluginHost(pluginTypes map[string]reflect.Type, symbols interp.Exports, embeddedPlugins fs.FS) *PluginHost

NewPluginHost initializes a PluginHost.

func (*PluginHost) GetPlugins

func (h *PluginHost) GetPlugins(typ string) (list []any)

GetPlugins returns a list of all plugins.

func (*PluginHost) LoadPlugin

func (h *PluginHost) LoadPlugin(config *PluginConfig) (map[string]any, error)

LoadPlugin loads a new plugin to the host.

Jump to

Keyboard shortcuts

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