plugin

package
v0.16.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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