plugins

package
v3.11.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

This package exists mainly to prevent a cycle when plugins need to use "app"

Index

Constants

This section is empty.

Variables

View Source
var InternalPlugins internalPluginMapping

Functions

This section is empty.

Types

type ActivatedLifecycler

type ActivatedLifecycler struct {
	*ActivatedPlugin
	Lifecycler iscenv.Lifecycler
}

type ActivatedPlugin

type ActivatedPlugin struct {
	Id     string
	Path   string
	Plugin interface{}
}

type ActivatedVersioner

type ActivatedVersioner struct {
	*ActivatedPlugin
	Versioner iscenv.Versioner
}

type InternalPlugin

type InternalPlugin interface {
	// Start the plugin
	Main()
	Key() string
}

An API for starting internal plugins

type LifecyclerManager

type LifecyclerManager struct {
	*PluginManager
}

func NewLifecyclerManager

func NewLifecyclerManager(args PluginArgs) (*LifecyclerManager, error)

func (*LifecyclerManager) ActivatePlugins

func (lm *LifecyclerManager) ActivatePlugins(pluginsToActivate []string) ([]*ActivatedLifecycler, error)

type PluginArgs

type PluginArgs struct {
	LogLevel string
	LogJSON  bool
}

func (PluginArgs) ToArgs

func (pa PluginArgs) ToArgs() []string

type PluginClient

type PluginClient struct {
	ExecutablePath string
	*plugin.Client
}

func (*PluginClient) RPCClient

func (pc *PluginClient) RPCClient() (*plugin.RPCClient, error)

Needed because the embedded struct is Client and it has a function called Client so it's client.Client() is ambiguous

type PluginManager

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

func NewPluginManager

func NewPluginManager(pluginType string, iscenvPlugin plugin.Plugin, args PluginArgs) (*PluginManager, error)

func (*PluginManager) ActivatePlugins

func (pm *PluginManager) ActivatePlugins(pluginsToActivate []string) ([]*ActivatedPlugin, error)

ActivatePlugins will activate the provided list of plugins. If the list is nil, it will activate all of the plugins. It does this by traversing all of the plugins dispensing them to the rpc client and then returning an object containing the Id of the plugin, the path to the executable (if not internal) and the raw plugin interface{} which the caller will likely want to typecast into something more useful. It will return the ActivatedPlugins in the same order as the pluginsToActivate and any error encountered

func (*PluginManager) AvailablePlugins

func (pm *PluginManager) AvailablePlugins() []string

func (*PluginManager) Close

func (pm *PluginManager) Close()

type VersionerManager

type VersionerManager struct {
	*PluginManager
}

func NewVersionerManager

func NewVersionerManager(args PluginArgs) (*VersionerManager, error)

func (*VersionerManager) ActivatePlugins

func (lm *VersionerManager) ActivatePlugins(pluginsToActivate []string) ([]*ActivatedVersioner, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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