plugin

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 14

Documentation

Index

Constants

View Source
const (
	ProtocolVersion  = 1
	MagicCookieKey   = "DODO_PLUGIN"
	MagicCookieValue = "69318785-d741-4150-ac91-8f03fa703530"
	FailedPlugin     = "error"
)

Variables

This section is empty.

Functions

func PathByName

func PathByName(name string) string

Types

type CircularDependencyError

type CircularDependencyError struct {
	Dependencies map[dependency]mapset.Set
}

func (CircularDependencyError) Error

func (e CircularDependencyError) Error() string

type Config added in v0.8.0

type Config map[string]string

type InvalidError

type InvalidError struct {
	Plugin  *core.PluginName
	Message string
}

func (InvalidError) Error

func (e InvalidError) Error() string

type Manager

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

func Init

func Init() Manager

func (Manager) GetPlugins

func (m Manager) GetPlugins(pluginType string) map[string]Plugin

func (Manager) IncludePlugins

func (m Manager) IncludePlugins(ps ...Plugin)

func (Manager) LoadPlugins

func (m Manager) LoadPlugins()

func (Manager) RegisterPluginTypes

func (m Manager) RegisterPluginTypes(ts ...Type)

func (Manager) ServePlugins

func (m Manager) ServePlugins(plugins ...Plugin) error

func (Manager) UnloadPlugins

func (m Manager) UnloadPlugins()

type NotFoundError

type NotFoundError struct {
	Plugin *core.PluginName
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Plugin

type Plugin interface {
	PluginInfo() *core.PluginInfo
	Init() (Config, error)
	Cleanup()

	Type() Type
}

func ResolveDependencies

func ResolveDependencies(pluginMap map[string]map[string]Plugin) []Plugin

type StreamConfig

type StreamConfig struct {
	Stdin          io.Reader
	Stdout         io.Writer
	Stderr         io.Writer
	TerminalHeight uint32
	TerminalWidth  uint32
}

type Type

type Type interface {
	String() string
	GRPCClient() (plugin.Plugin, error)
	GRPCServer(Plugin) (plugin.Plugin, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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