Help us shape the future of Go! Take the 2026 Go Developer Survey

plugins

package module
v0.4.103 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 15 Imported by: 2

README

Plugins

Plugins is a plugin helper controller

Documentation

Index

Constants

View Source
const (
	// ErrExpectedEndParen is returned when an ending parenthesis is missing
	ErrExpectedEndParen = errors.Error("expected ending parenthesis")
	// ErrInvalidDir is returned when a directory is empty
	ErrInvalidDir = errors.Error("invalid directory, cannot be empty")
	// ErrPluginKeyExists is returned when a plugin cannot be added because it already exists
	ErrPluginKeyExists = errors.Error("plugin cannot be added, key already exists")
	// ErrPluginNotLoaded is returned when a plugin namespace is provided that has not been loaded
	ErrPluginNotLoaded = errors.Error("plugin with that key has not been loaded")
	// ErrNotAddressable is returned when a non-addressable value is provided
	ErrNotAddressable = errors.Error("provided backend must be addressable")
)

Variables

This section is empty.

Functions

func ParseKey

func ParseKey(key string) (newKey, alias string)

ParseKey returns stripped gitUrl and plugin alias

Types

type Plugin

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

Plugin represents a plugin entry

type Plugins

type Plugins struct {

	// Override config if set
	Branch string
	// contains filtered or unexported fields
}

Plugins manages loaded plugins

func New

func New(dir string) (pp *Plugins, err error)

New will return a new instance of plugins

func (*Plugins) Backend

func (p *Plugins) Backend(key string, backend interface{}) (err error)

Backend will associated the backend of the requested key

func (*Plugins) Build

func (p *Plugins) Build() (err error)

Build will build all of the plugins

func (*Plugins) BuildAsync

func (p *Plugins) BuildAsync(q *queue.Queue) (err error)

BuildAsync will build all of the plugins asynchronously

func (*Plugins) Close

func (p *Plugins) Close() (err error)

Close will close plugins

func (*Plugins) Get

func (p *Plugins) Get(key string) (plugin *plugin.Plugin, err error)

Get will return a plugin by key

func (*Plugins) Initialize

func (p *Plugins) Initialize() (err error)

Initialize will initialize all loaded plugins

func (*Plugins) New

func (p *Plugins) New(pluginKey string, update bool) (key string, err error)

New will load a new plugin by plugin key The following formats are accepted as keys:

  • path/to/file/plugin.so
  • github.com/username/repository/pluginDir

func (*Plugins) Retrieve

func (p *Plugins) Retrieve() (err error)

Retrieve will update or download all of the plugins

func (*Plugins) Test

func (p *Plugins) Test() (err error)

Test will test all of the plugins

func (*Plugins) TestAsync

func (p *Plugins) TestAsync(q *queue.Queue) (err error)

TestAsync will test all of the plugins asynchronously

Jump to

Keyboard shortcuts

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