Documentation
¶
Overview ¶
Package xps provides helper and conventions for working with the go plugin system
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cmd ¶
Cmd is the type signature and name we check for plugin subcommands. The dir is the assumed working dir and args start with the plugin name itself.
type CmdCtx ¶
type CmdRedir ¶
type CmdRedir struct{ Cmd string }
CmdRedir is capability extension for plugin commands wrapped as an error. Plugin commands can change the default program environment to be reused by a xelf commands.
type Manifest ¶
type Manifest struct { Path string `json:"-"` Name string `json:"name"` // Caps holds all plugin capabilities, most prominently mods and cmds. // mods should be a list of provided modules // cmds a dict with command keys and help values Caps lit.Keyed `json:"caps,omitempty"` }
Manifest provides the plugin path, name and a list of provided module paths.
func FindAll ¶
FindAll walks roots and returns all plugin manifests that were found. It skips node_modules and testdata directories, and hidden files starting with a dot.
type ModLoader ¶
ModLoader wrapps a SysMods module source registry with a plugin list. It lazy-loads plugins that provide module source missing from the registry.
type Plug ¶
Plug wraps a go plugin with a manifest. The manifest must use the '.so.xelf' file extension, thereby encoding the expected location of the plugin binary.