plugin

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: ISC Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPluginExist        = errors.New("plugin already registered")
	ErrPluginNotExist     = errors.New("plugin not registered")
	ErrPluginTypeMismatch = errors.New("plugin type mismatch")
)

Functions

This section is empty.

Types

type ExitConn

type ExitConn interface {
	net.Conn
	Exited() <-chan struct{}
	WaitErr() error
}

func ConnectPlugin

func ConnectPlugin(ctx context.Context, pluginPath string, args []string) (grpc.ClientConnInterface, ExitConn, error)

func NewStdioConn

func NewStdioConn(stdin, stdout *os.File, cmd *exec.Cmd) ExitConn

type ExporterPluginConn

type ExporterPluginConn struct {
	exporter.Exporter
	// contains filtered or unexported fields
}

func (*ExporterPluginConn) Close

func (c *ExporterPluginConn) Close(ctx context.Context) error

type ImporterPluginConn

type ImporterPluginConn struct {
	importer.Importer
	// contains filtered or unexported fields
}

func (*ImporterPluginConn) Close

func (c *ImporterPluginConn) Close(ctx context.Context) error

type Plugin

type Plugin struct {
	Name     string
	Version  string
	Type     pkg.ConnectorType
	Protocol string
	Flags    location.Flags
	Exec     string
	Args     []string
}

func (*Plugin) Connect

func (*Plugin) NewExporter

func (plugin *Plugin) NewExporter(ktx *kcontext.KContext, proto string, params map[string]string, opts *connectors.Options) (exporter.Exporter, error)

func (*Plugin) NewImporter

func (plugin *Plugin) NewImporter(ktx *kcontext.KContext, proto string, params map[string]string, opts *connectors.Options) (importer.Importer, error)

func (*Plugin) NewStorage

func (plugin *Plugin) NewStorage(ktx *kcontext.KContext, proto string, params map[string]string) (storage.Store, error)

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) GetPlugin

func (registry *Registry) GetPlugin(name, version string, conntype pkg.ConnectorType, protocol string) (*Plugin, error)

func (*Registry) ListPlugins

func (registry *Registry) ListPlugins() iter.Seq2[*Plugin, error]

func (*Registry) RegisterPlugins

func (registry *Registry) RegisterPlugins(m *pkg.Manifest, p *pkg.Package, pkgdir string) error

func (*Registry) UnregisterPlugins

func (registry *Registry) UnregisterPlugins(m *pkg.Manifest, p *pkg.Package)

type StdioConn

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

func (*StdioConn) Close

func (c *StdioConn) Close() (ret error)

func (*StdioConn) Exited

func (c *StdioConn) Exited() <-chan struct{}

func (*StdioConn) LocalAddr

func (c *StdioConn) LocalAddr() net.Addr

func (*StdioConn) Read

func (c *StdioConn) Read(b []byte) (int, error)

func (*StdioConn) RemoteAddr

func (c *StdioConn) RemoteAddr() net.Addr

func (*StdioConn) SetDeadline

func (c *StdioConn) SetDeadline(t time.Time) error

func (*StdioConn) SetReadDeadline

func (c *StdioConn) SetReadDeadline(t time.Time) error

func (*StdioConn) SetWriteDeadline

func (c *StdioConn) SetWriteDeadline(t time.Time) error

func (*StdioConn) WaitErr

func (c *StdioConn) WaitErr() error

func (*StdioConn) Write

func (c *StdioConn) Write(b []byte) (int, error)

type StoragePluginConn

type StoragePluginConn struct {
	storage.Store
	// contains filtered or unexported fields
}

func (*StoragePluginConn) Close

func (c *StoragePluginConn) Close(ctx context.Context) error

Directories

Path Synopsis
Package logging is a minimal stand-in for plakman's daemonize/logging, so the copied plugin package stays dependency-free.
Package logging is a minimal stand-in for plakman's daemonize/logging, so the copied plugin package stays dependency-free.

Jump to

Keyboard shortcuts

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