Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InternalPluginHandler ¶
type PluginLoader ¶
type PluginLoader struct { *config.Config SelectedPluginKey *plugins.PluginKey SelectedPluginConfig interface{} // contains filtered or unexported fields }
PluginLoader handles finding, configuring and loading porter plugins.
func NewPluginLoader ¶
func NewPluginLoader(c *config.Config, createInternalPlugin InternalPluginHandler) *PluginLoader
func (*PluginLoader) Load ¶
func (l *PluginLoader) Load(pluginType PluginTypeConfig) (interface{}, func(), error)
Load a plugin, returning the plugin's interface which the caller must then cast to the typed interface, a cleanup function to stop the plugin when finished communicating with it, and an error if the plugin could not be loaded.
type PluginTypeConfig ¶
type PluginTypeConfig struct { // Name of the plugin type interface. Interface string // Plugin to communicate with the plugin Plugin plugin.Plugin // GetDefaultPluggable is the function on porter's configuration // to retrieve a pluggable configuration value's named default instance to use, e.g. "default-storage" GetDefaultPluggable func(c *config.Config) string // GetPluggable is the function on porter's configuration // to retrieve a named pluggable instance, e.g. a storage named "azure" GetPluggable func(c *config.Config, name string) (Entry, error) // GetDefaultPlugin is the function on porter's configuration // to retrieve the default plugin to use for a type of plugin, e.g. "storage-plugin" GetDefaultPlugin func(c *config.Config) string // ProtocolVersion is the version of the protocol used by this plugin. ProtocolVersion uint }
PluginTypeConfig defines a set of functions to access a type of plugin's data in the porter config file.
Click to show internal directories.
Click to hide internal directories.