plugins

package
Version: v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPluginWithNameFound = fmt.Errorf("no plugin with that name could be found in the pluginCache")

Functions

This section is empty.

Types

type CommandSpec added in v0.9.8

type CommandSpec struct {
	Cmd         string        `yaml:"cmd"`
	Help        string        `yaml:"help,omitempty"`
	Subcommands []CommandSpec `yaml:"subcommands,omitempty"`
}

type Config added in v0.9.8

type Config struct {
	Out    io.Writer
	Fs     afero.Fs
	Pather devctlpath.Pather
}

type ConfigSpec added in v0.9.8

type ConfigSpec struct {
	Values  map[string]string
	Static  map[string]interface{}
	Dynamic map[string]string
}

func ResolveDynamic added in v0.9.8

func ResolveDynamic(c ConfigSpec, e *Engine) (cfg ConfigSpec, err error)

type Engine added in v0.9.8

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine added in v0.9.8

func NewEngine(opts ...Option) *Engine

func (*Engine) Execute added in v0.9.8

func (e *Engine) Execute(pluginName string, args []string) (err error)

Execute tries to execute a named plugin from the cache

func (*Engine) LoadPlugin added in v0.9.8

func (e *Engine) LoadPlugin(manifestPath string) (p *Plugin, err error)

func (*Engine) LoadPlugins added in v0.9.8

func (e *Engine) LoadPlugins() (plugins Plugins)

func (*Engine) NewExecutablePlugin added in v0.9.8

func (e *Engine) NewExecutablePlugin(p *Plugin, config map[string]interface{}) (execP *ExecutablePlugin, err error)

type ExecutablePlugin added in v0.9.8

type ExecutablePlugin struct {
	*Plugin
	Config reflect.Value
	ExecFn reflect.Value
}

func (*ExecutablePlugin) Exec added in v0.9.8

func (execP *ExecutablePlugin) Exec(args []string) (err error)

type Manifest added in v0.9.8

type Manifest struct {
	Version    string `yaml:"version"`
	PluginSpec `yaml:"plugin"`
}

type Option added in v0.9.8

type Option func(c *Config) *Config

type Plugin added in v0.9.0

type Plugin struct {
	*Manifest
	Source   string
	RootPath string
}

type PluginSpec added in v0.9.8

type PluginSpec struct {
	*CommandSpec `yaml:"cmd,inline"`
	Name         string     `yaml:"name"`
	Pkg          string     `yaml:"pkg"`
	Config       ConfigSpec `yaml:"config,omitempty"`
}

type Plugins added in v0.9.8

type Plugins []*Plugin

Jump to

Keyboard shortcuts

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