plugin

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package plugin provides go-plugin infrastructure for loading and serving executor plugins out-of-process via gRPC with server-side streaming.

Plugin authors implement executor.ExecutorPlugin and serve it via:

func main() {
    goplugin.Serve(&goplugin.ServeConfig{
        HandshakeConfig: sdkplugin.HandshakeConfig,
        GRPCServer:      goplugin.DefaultGRPCServer,
        Plugins: map[string]goplugin.Plugin{
            "executor": &sdkplugin.GRPCExecutorPlugin{Impl: &MyPlugin{}},
        },
    })
}

Index

Constants

View Source
const (
	MagicCookieKey   = "FLOWCTL_EXECUTOR_PLUGIN"
	MagicCookieValue = "1a2e63941726d309b6f4d5da6410185c"
)

Variables

HandshakeConfig is the go-plugin handshake configuration.

View Source
var PluginMap = map[string]goplugin.Plugin{
	"executor": &GRPCExecutorPlugin{},
}

PluginMap maps the plugin name to the go-plugin Plugin implementation.

Functions

func LoadPlugin

func LoadPlugin(path string) (*goplugin.Client, executor.ExecutorPlugin, error)

LoadPlugin starts an external plugin binary and returns the go-plugin client and the ExecutorPlugin interface to interact with it.

Types

type GRPCExecutorPlugin

type GRPCExecutorPlugin struct {
	goplugin.NetRPCUnsupportedPlugin
	Impl executor.ExecutorPlugin
}

GRPCExecutorPlugin is the go-plugin Plugin implementation using gRPC. Set Impl on the server side (plugin binary); leave nil on the client side.

func (*GRPCExecutorPlugin) GRPCClient

func (p *GRPCExecutorPlugin) GRPCClient(ctx context.Context, broker *goplugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)

func (*GRPCExecutorPlugin) GRPCServer

func (p *GRPCExecutorPlugin) GRPCServer(broker *goplugin.GRPCBroker, s *grpc.Server) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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