Documentation ¶
Index ¶
- func Preload(plugins ...plugin.Plugin)
- type PluginLoader
- func (loader *PluginLoader) Close() error
- func (loader *PluginLoader) Initialize() error
- func (loader *PluginLoader) Inject() error
- func (loader *PluginLoader) Load(pl plugin.Plugin) error
- func (loader *PluginLoader) LoadDirectory(pluginDir string) error
- func (loader *PluginLoader) Start(node *core.IpfsNode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PluginLoader ¶
type PluginLoader struct {
// contains filtered or unexported fields
}
PluginLoader keeps track of loaded plugins.
To use:
- Load any desired plugins with Load and LoadDirectory. Preloaded plugins will automatically be loaded.
- Call Initialize to run all initialization logic.
- Call Inject to register the plugins.
- Optionally call Start to start plugins.
- Call Close to close all plugins.
func NewPluginLoader ¶
func NewPluginLoader(repo string) (*PluginLoader, error)
NewPluginLoader creates new plugin loader
func (*PluginLoader) Close ¶
func (loader *PluginLoader) Close() error
Close stops all long-running plugins.
func (*PluginLoader) Initialize ¶
func (loader *PluginLoader) Initialize() error
Initialize initializes all loaded plugins
func (*PluginLoader) Inject ¶
func (loader *PluginLoader) Inject() error
Inject hooks all the plugins into the appropriate subsystems.
func (*PluginLoader) Load ¶
func (loader *PluginLoader) Load(pl plugin.Plugin) error
Load loads a plugin into the plugin loader.
func (*PluginLoader) LoadDirectory ¶
func (loader *PluginLoader) LoadDirectory(pluginDir string) error
LoadDirectory loads a directory of plugins into the plugin loader.
Click to show internal directories.
Click to hide internal directories.