plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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

	ErrPluginInvalid        PluginError = "invalid plugin"
	ErrPluginNotImplemented PluginError = "not implemented"
	ErrPluginNotFound       PluginError = "plugin not found"
	ErrNoValidPluginFound   PluginError = "no valid plugin found"
)

Variables

This section is empty.

Functions

func GetPlugins

func GetPlugins(pluginType string) map[string]Plugin

func IncludePlugins

func IncludePlugins(ps ...Plugin)

func LoadPlugins

func LoadPlugins()

func PathByName

func PathByName(name string) string

func RegisterPluginTypes

func RegisterPluginTypes(ts ...Type)

func ServePlugins

func ServePlugins(plugins ...Plugin) error

func UnloadPlugins

func UnloadPlugins()

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 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 {
	Type() Type
	PluginInfo() (*api.PluginInfo, error)
}

type PluginError

type PluginError string
const (
	ErrNoStreamingConnection PluginError = "no streaming connection established"
)

func (PluginError) Error

func (e PluginError) Error() 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