plugins

package module
v0.0.0-...-289cda9 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 6 Imported by: 19

README

plugins

GoDoc

Requirements
  • Go 1.13+
  • Go Modules

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(plugs []Plugin)

Sort will sort a slice of plugins, by wrapping them in Plugins and using it's sort.Interface implementation.

func Wrap

func Wrap(p Plugin, err error) error

Types

type Feeder

type Feeder func() []Plugin

type Needer

type Needer interface {
	WithPlugins(Feeder)
}

Needer can be implemented to receive a Feeder function that can be used to gain access to other plugins in the system.

type Plugin

type Plugin interface {
	PluginName() string
}

Plugin is the most basic interface a plugin can implement.

type Plugins

type Plugins []Plugin

Plugins is a slice of type `Plugin` that provides additional useful functionality.

func (Plugins) Len

func (p Plugins) Len() int

Len is the number of elements in the collection.

func (Plugins) Less

func (p Plugins) Less(i int, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (Plugins) ScopedPlugins

func (plugs Plugins) ScopedPlugins() []Plugin

ScopedPlugins implements Scoper, return itself.

func (Plugins) Swap

func (p Plugins) Swap(i int, j int)

Swap swaps the elements with indexes i and j.

type Scoper

type Scoper interface {
	ScopedPlugins() []Plugin
}

Scoper can be implemented to return a slice of plugins that are important to the type defining it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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