plugin

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 13 Imported by: 1 module, 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 IPlugin added in v0.2.2

type IPlugin interface {
	Start() (net.Addr, error)
	Stop()
	Dispense() (pluginV1.GatewayDPluginServiceClient, *gerr.GatewayDError)
}

type IPluginRegistry added in v0.2.2

type IPluginRegistry interface {
	Add(plugin *Plugin) bool
	Get(id Identifier) *Plugin
	List() []Identifier
	Exists(name, version, remoteURL string) bool
	Remove(id Identifier)
	Shutdown()
	LoadPlugins(plugins []config.Plugin)
	RegisterHooks(id Identifier)
}

type Identifier added in v0.0.8

type Identifier struct {
	Name      string
	Version   string
	RemoteURL string
	Checksum  string
}

type Plugin added in v0.0.8

type Plugin struct {
	goplugin.NetRPCUnsupportedPlugin
	pluginV1.GatewayDPluginServiceServer

	ID          Identifier
	Description string
	Authors     []string
	License     string
	ProjectURL  string
	LocalPath   string
	Args        []string
	Env         []string
	Enabled     bool
	// internal and external config options
	Config map[string]string
	// hooks it attaches to
	Hooks    []hook.Type
	Priority hook.Priority
	// required plugins to be loaded before this one
	// Built-in plugins are always loaded first
	Requires   []Identifier
	Tags       []string
	Categories []string
	// contains filtered or unexported fields
}

func (*Plugin) Dispense added in v0.0.8

Dispense returns the plugin client.

func (*Plugin) Start added in v0.0.8

func (p *Plugin) Start() (net.Addr, error)

Start starts the plugin.

func (*Plugin) Stop added in v0.0.8

func (p *Plugin) Stop()

Stop kills the plugin.

type PluginRegistry added in v0.2.2

type PluginRegistry struct {
	CompatPolicy config.CompatPolicy
	// contains filtered or unexported fields
}

func NewRegistry added in v0.0.8

func NewRegistry(hooksConfig *hook.Config) *PluginRegistry

NewRegistry creates a new plugin registry.

func (*PluginRegistry) Add added in v0.2.2

func (reg *PluginRegistry) Add(plugin *Plugin) bool

Add adds a plugin to the registry.

func (*PluginRegistry) Exists added in v0.2.2

func (reg *PluginRegistry) Exists(name, version, remoteURL string) bool

Exists checks if a plugin exists in the registry.

func (*PluginRegistry) Get added in v0.2.2

func (reg *PluginRegistry) Get(id Identifier) *Plugin

Get returns a plugin from the registry.

func (*PluginRegistry) List added in v0.2.2

func (reg *PluginRegistry) List() []Identifier

List returns a list of all plugins in the registry.

func (*PluginRegistry) LoadPlugins added in v0.2.2

func (reg *PluginRegistry) LoadPlugins(plugins []config.Plugin)

LoadPlugins loads plugins from the config file.

func (*PluginRegistry) RegisterHooks added in v0.2.2

func (reg *PluginRegistry) RegisterHooks(id Identifier)

RegisterHooks registers the hooks for the given plugin.

func (*PluginRegistry) Remove added in v0.2.2

func (reg *PluginRegistry) Remove(id Identifier)

Remove removes a plugin from the registry.

func (*PluginRegistry) Shutdown added in v0.2.2

func (reg *PluginRegistry) Shutdown()

Shutdown shuts down all plugins in the registry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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