Documentation
¶
Index ¶
- type IPlugin
- type IPluginRegistry
- type Identifier
- type Plugin
- type PluginRegistry
- func (reg *PluginRegistry) Add(plugin *Plugin) bool
- func (reg *PluginRegistry) Exists(name, version, remoteURL string) bool
- func (reg *PluginRegistry) Get(id Identifier) *Plugin
- func (reg *PluginRegistry) List() []Identifier
- func (reg *PluginRegistry) LoadPlugins(plugins []config.Plugin)
- func (reg *PluginRegistry) RegisterHooks(id Identifier)
- func (reg *PluginRegistry) Remove(id Identifier)
- func (reg *PluginRegistry) Shutdown()
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 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
func (p *Plugin) Dispense() (pluginV1.GatewayDPluginServiceClient, *gerr.GatewayDError)
Dispense returns the plugin client.
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.
Click to show internal directories.
Click to hide internal directories.