grpc

package
v0.0.0-...-d9d3ccb Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = goplugin.HandshakeConfig{
	ProtocolVersion:  2,
	MagicCookieKey:   "FORGE_PLUGIN",
	MagicCookieValue: "forge",
}

Handshake is the plugin handshake configuration. Plugins and hosts must use the same values to communicate.

View Source
var Plugins = map[string]goplugin.Plugin{
	"driver": &DriverPlugin{},
}

Plugins is the map of supported plugin types for use with go-plugin.

Functions

func Serve

func Serve(df plugins.DriverFactory)

Serve starts the plugin process and serves the Driver over gRPC.

func ServeContext

func ServeContext(dcf DriverContextFactory)

ServeContext starts the plugin with context support for cancellation.

func ServeContextWithLogger

func ServeContextWithLogger(dcf DriverContextFactory, logger hclog.Logger)

ServeContextWithLogger starts the plugin with context support and a custom logger.

func ServeWithLogger

func ServeWithLogger(df plugins.DriverFactory, logger hclog.Logger)

ServeWithLogger starts the plugin with a custom logger.

Types

type DriverContextFactory

type DriverContextFactory func(ctx func() context.Context, log hclog.Logger) plugins.Driver

DriverContextFactory creates a Driver with context support (external plugins only).

type DriverPlugin

type DriverPlugin struct {
	goplugin.Plugin
	Impl plugins.Driver
}

DriverPlugin is the hashicorp/go-plugin wrapper for the Driver interface.

func (*DriverPlugin) GRPCClient

func (p *DriverPlugin) GRPCClient(ctx context.Context, broker *goplugin.GRPCBroker, c *grpc.ClientConn) (any, error)

func (*DriverPlugin) GRPCServer

func (p *DriverPlugin) 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