Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginLoader ¶
type PluginLoader struct { *config.Config SelectedPluginKey *plugins.PluginKey SelectedPluginConfig interface{} }
PluginLoader handles finding, configuring and loading porter plugins.
func NewPluginLoader ¶
func NewPluginLoader(c *config.Config) *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 config.Data // to retrieve a pluggable configuration value's named default instance to use, e.g. "default-storage" GetDefaultPluggable func(datastore *config.Data) string // GetPluggable is the function on porter's config.Data // to retrieve a named pluggable instance, e.g. a storage named "azure" GetPluggable func(datastore *config.Data, name string) (Entry, error) // GetDefaultPlugin is the function on porter's config.Data // to retrieve the default plugin to use for a type of plugin, e.g. "storage-plugin" GetDefaultPlugin func(datastore *config.Data) string }
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.