grpc

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package grpc provides the gRPC-based plugin runtime implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHCLogAdapter

func NewHCLogAdapter() hclog.Logger

NewHCLogAdapter creates a logger adapter that discards go-plugin internal logs.

Types

type GrpcPlugin

type GrpcPlugin struct {
	goPlugin.NetRPCUnsupportedPlugin
}

GrpcPlugin is the hashicorp/go-plugin adapter.

func (*GrpcPlugin) GRPCClient

func (*GrpcPlugin) GRPCClient(_ context.Context, _ *goPlugin.GRPCBroker, c *grpc.ClientConn) (any, error)

func (*GrpcPlugin) GRPCServer

func (*GrpcPlugin) GRPCServer(_ *goPlugin.GRPCBroker, _ *grpc.Server) error

type GrpcRunner

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

GrpcRunner implements plugin.Runner using hashicorp/go-plugin.

func NewGrpcRunner

func NewGrpcRunner(m *plugin.Manifest) (*GrpcRunner, error)

NewGrpcRunner creates a gRPC runner for a plugin manifest.

func (*GrpcRunner) Call

func (r *GrpcRunner) Call(ctx context.Context, function string, params json.RawMessage) (json.RawMessage, error)

Call invokes a named function on the plugin.

func (*GrpcRunner) Health

func (r *GrpcRunner) Health(ctx context.Context) (*plugin.HealthStatus, error)

Health checks the plugin's readiness.

func (*GrpcRunner) Load

Load connects to the plugin process and retrieves its PluginInfo.

func (*GrpcRunner) SetHostAPI

func (r *GrpcRunner) SetHostAPI(api plugin.HostAPI)

SetHostAPI sets the HostAPI for this runner (called by PluginManager).

func (*GrpcRunner) Start

func (r *GrpcRunner) Start(ctx context.Context, config json.RawMessage) error

Start initializes the plugin via the Init() RPC.

func (*GrpcRunner) Stop

func (r *GrpcRunner) Stop(ctx context.Context) error

Stop gracefully drains in-flight calls and kills the plugin process.

type HCLogAdapter

type HCLogAdapter struct {
	hclog.Logger
}

HCLogAdapter adapts go-plugin's hclog to flowbot's logging.

type HostServer

type HostServer struct {
	pb.UnimplementedHostServiceServer
	// contains filtered or unexported fields
}

HostServer implements pb.HostServiceServer and delegates to a plugin.HostAPI.

func NewHostServer

func NewHostServer(api plugin.HostAPI) *HostServer

NewHostServer creates a HostServer with the given HostAPI.

func (*HostServer) EmitEvent

func (h *HostServer) EmitEvent(ctx context.Context, req *pb.EmitEventRequest) (*emptypb.Empty, error)

func (*HostServer) GetConfig

func (h *HostServer) GetConfig(ctx context.Context, req *pb.GetConfigRequest) (*pb.GetConfigResponse, error)

func (*HostServer) HTTPRequest

func (h *HostServer) HTTPRequest(ctx context.Context, req *pb.HTTPCallRequest) (*pb.HTTPCallResponse, error)

func (*HostServer) KVDelete

func (h *HostServer) KVDelete(ctx context.Context, req *pb.KVDeleteRequest) (*emptypb.Empty, error)

func (*HostServer) KVGet

func (h *HostServer) KVGet(ctx context.Context, req *pb.KVGetRequest) (*pb.KVGetResponse, error)

func (*HostServer) KVSet

func (h *HostServer) KVSet(ctx context.Context, req *pb.KVSetRequest) (*emptypb.Empty, error)

func (*HostServer) Log

func (h *HostServer) Log(ctx context.Context, req *pb.LogRequest) (*emptypb.Empty, error)

func (*HostServer) Register

func (h *HostServer) Register(s *grpc.Server)

Register registers this server on a gRPC server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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