plugin

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

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 CancelCopier

type CancelCopier struct {
	Src io.Reader
	Dst io.Writer
	// contains filtered or unexported fields
}

func NewCancelCopier

func NewCancelCopier(src io.Reader, dst io.Writer) *CancelCopier

func (*CancelCopier) Close

func (c *CancelCopier) Close()

func (*CancelCopier) Copy

func (c *CancelCopier) Copy() error

type Copier

type Copier interface {
	Copy() error
}

type DemuxCopier

type DemuxCopier struct {
	Src    io.Reader
	DstOut io.Writer
	DstErr io.Writer
	// contains filtered or unexported fields
}

func NewDemuxCopier

func NewDemuxCopier(src io.Reader, dstOut io.Writer, dstErr io.Writer) *DemuxCopier

func (*DemuxCopier) Copy

func (c *DemuxCopier) Copy() error

type ErrCircularDependency added in v0.2.0

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

func (ErrCircularDependency) Error added in v0.3.0

func (e ErrCircularDependency) Error() string

type ErrInvalidPlugin added in v0.3.0

type ErrInvalidPlugin struct {
	Plugin  *api.PluginName
	Message string
}

func (ErrInvalidPlugin) Error added in v0.3.0

func (e ErrInvalidPlugin) Error() string

type ErrPluginNotFound

type ErrPluginNotFound struct {
	Plugin *api.PluginName
}

func (ErrPluginNotFound) Error added in v0.3.0

func (e ErrPluginNotFound) Error() string

type Manager added in v0.2.0

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

func Init added in v0.2.0

func Init() Manager

func (Manager) GetPlugins added in v0.2.0

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

func (Manager) IncludePlugins added in v0.2.0

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

func (Manager) LoadPlugins added in v0.2.0

func (m Manager) LoadPlugins()

func (Manager) RegisterPluginTypes added in v0.2.0

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

func (Manager) ServePlugins added in v0.2.0

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

func (Manager) UnloadPlugins added in v0.2.0

func (Manager) UnloadPlugins()

type MuxCopier

type MuxCopier struct {
	SrcOut io.Reader
	SrcErr io.Reader
	Dst    io.Writer
	// contains filtered or unexported fields
}

func NewMuxCopier

func NewMuxCopier(srcOut io.Reader, srcErr io.Reader, dst io.Writer) *MuxCopier

func (*MuxCopier) Copy

func (c *MuxCopier) Copy() error

type Plugin

type Plugin interface {
	PluginInfo() *api.PluginInfo
	Init() (PluginConfig, error)

	Type() Type
}

func ResolveDependencies added in v0.2.0

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

type PluginConfig added in v0.2.0

type PluginConfig map[string]string

type StdioClient

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

func NewStdioClient

func NewStdioClient(url string) (*StdioClient, error)

func (*StdioClient) Copy

func (c *StdioClient) Copy(inStream io.Reader, outStream io.Writer, errStream io.Writer) error

type StdioServer

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

func NewStdioServer

func NewStdioServer() (*StdioServer, error)

func (*StdioServer) Copy

func (s *StdioServer) Copy(inStream io.Writer, outStream io.Reader, errStream io.Reader) error

func (*StdioServer) Endpoint

func (s *StdioServer) Endpoint() string

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