pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPlugin

func BuildPlugin(output string, dir string) error

BuildPlugin builds package into a plugin

func BuildPlugins

func BuildPlugins(output string, dirs []string) error

BuildPlugins accepts multiple directories to be built

func NewHandler

func NewHandler() plugin.Handler

NewHandler creates & returns pkg.Handler structure

Types

type Handler

type Handler struct {
	plugin.Handler
	// contains filtered or unexported fields
}

Handler struct. This implements plugin/Handler interface and handles the plugins

func (*Handler) Emit

func (m *Handler) Emit(name plugin.Event, v interface{})

Emit emits an event, triggering any registered callbacks for events of the same name registered through On

func (*Handler) GetPlugins

func (m *Handler) GetPlugins() []plugin.Plugin

GetPlugins will return an array of registered plugins

func (*Handler) GetServices

func (m *Handler) GetServices() []plugin.Service

GetServices will return an array of Service plugins

func (*Handler) LoadPlugin

func (m *Handler) LoadPlugin(v plugin.Plugin) error

LoadPlugin will take a struct that implements plugin.Plugin and load it into the Handler

func (*Handler) LoadPluginDir

func (m *Handler) LoadPluginDir(directory string) error

LoadPluginDir will load all plugins in provided directory path

func (*Handler) LoadPluginPath

func (m *Handler) LoadPluginPath(path string) error

LoadPluginPath will load a plugin via a file path

func (*Handler) On

func (m *Handler) On(name plugin.Event, callback func(v interface{}))

On registers a callback function, triggered on each emit of an event with the given name

func (*Handler) Walk

func (m *Handler) Walk(handler func(manifest *plugin.Manifest, v plugin.Plugin))

Walk will take you on a walk through the registered plugins for each plugin, the handler function passed through will be called

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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