plugins

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 4 Imported by: 0

README

Plugins

Plugins are triggered by actions defined on bolt.observer site.

Structure

Each plugin must be in it's own directory. Directory name must match action name defined on bolt.observer site. It must implement Plugin interface defined in entities/plugin.go.

Compile time enablement

We are using tag plugins so you can build agent without plugins too. By default plugins are enabled (go build -tags=plugins). To make everything work in Visual Studio Code, go to Settings / Settings / Gopls / Edit settings.json and add

"go.testTags": "plugins",
"gopls": {
    "build.buildFlags": ["-tags=plugins"]
}

Run-time control

There is an option --noplugins to disable all plugins even though you might have them compiled in the release.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AllPluginFlags hold the extra flags for plugins
	AllPluginFlags []cli.Flag
	// AllPluginCommands hold the extra commands for plugins
	AllPluginCommands []cli.Command
	Plugins           map[string]agent_entities.Plugin
	RegisteredPlugins []PluginData
)

Functions

func InitPlugins

func InitPlugins(lnAPI api.NewAPICall, filter filter.FilteringInterface, cmdCtx *cli.Context, nodeDataInvalidator agent_entities.Invalidatable) error

Types

type InitPluginFn added in v0.2.0

type InitPluginFn func(lnAPI api.NewAPICall, filter filter.FilteringInterface, cmdCtx *cli.Context, nodeDataInvalidator agent_entities.Invalidatable) (agent_entities.Plugin, error)

InitPluginFn signature of init plugin function

type PluginData added in v0.2.0

type PluginData struct {
	Name string
	Init InitPluginFn
}

PluginData structure

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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