plugin

package
v0.0.0-...-c4175cc Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SymbolName = "NewPlugin"

Variables

This section is empty.

Functions

func BuildVersion

func BuildVersion(version, commit string) string

func Contains

func Contains(arr []string, str string) bool

func LoadPlugins

func LoadPlugins(dir string) error

func Register

func Register(symbols ...Symbol)

Register registers a global plugins

func Subscription

func Subscription(handlers ...interface{}) Subscriber

Types

type Manager

type Manager interface {
	Flags(module string) []cli.Flag
	Subscriber(module string) (*subscription.SubscribeManager, error)
}

func NewPluginManager

func NewPluginManager(cfg map[string]*ucfg.Config) Manager

type Plugin

type Plugin interface {
	metadata.Plugin
}

type PluginsLoader

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

func NewPluginsLoader

func NewPluginsLoader(dir string) *PluginsLoader

func (*PluginsLoader) LoadPlugins

func (pl *PluginsLoader) LoadPlugins(force bool) error

func (*PluginsLoader) Plugins

func (pl *PluginsLoader) Plugins() []Symbol

type Symbol

type Symbol struct {
	Name    string
	Version string
	Desc    string
	New     func(cfg *ucfg.Config) (Plugin, error)
	Modules []string
	Flags   []cli.Flag
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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