plugin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package plugin provides the ability to load plugins

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(path string, p *Plugin) error

Build generates a dso plugin using the go command `go build -buildmode=plugin`

func Commands

func Commands() []cli.Command

Commands returns license commands

func Generate

func Generate(path string, p *Plugin) error

Generate creates a go file at the specified path. You must use `go build -buildmode=plugin`to build it.

func Init

func Init(p *Plugin) error

Init sets up the plugin

func NewPlugin

func NewPlugin() plugin.Plugin

returns a micro plugin which loads plugins

Types

type Plugin

type Plugin struct {
	// Name of the plugin e.g rabbitmq
	Name string
	// Type of the plugin e.g broker
	Type string
	// Path specifies the import path
	Path string
	// NewFunc creates an instance of the plugin
	NewFunc interface{}
}

Plugin is a plugin loaded from a file

func Load

func Load(path string) (*Plugin, error)

Load loads a plugin created with `go build -buildmode=plugin`

Jump to

Keyboard shortcuts

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