plugin

package
v0.0.0-...-83979ee Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package plugin 提供gRPC插件通信实现 创建者:Done-0 创建时间:2025-08-05

Package plugin 提供插件系统核心接口定义 创建者:Done-0 创建时间:2025-08-05

Index

Constants

This section is empty.

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "JANK_PLUGIN",
	MagicCookieValue: "jank-plugin",
}

HandshakeConfig 插件握手配置

PluginMap 定义支持的插件接口类型映射(按功能分类)

Functions

func NewGRPCPlugin

func NewGRPCPlugin(impl Plugin) plugin.Plugin

NewGRPCPlugin 创建 gRPC 插件

Types

type GRPCPlugin

type GRPCPlugin struct {
	plugin.Plugin
	Impl Plugin
}

GRPCPlugin gRPC 插件实现

func (*GRPCPlugin) GRPCClient

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

GRPCClient 创建 gRPC 客户端

func (*GRPCPlugin) GRPCServer

func (p *GRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer 创建 gRPC 服务端

type Plugin

type Plugin interface {
	Execute(ctx context.Context, method string, args map[string]any) (map[string]any, error)
	HealthCheck(ctx context.Context) error
}

Plugin 插件接口定义

Directories

Path Synopsis
Package consts 提供应用程序常量定义 创建者:Done-0 创建时间:2025-08-05
Package consts 提供应用程序常量定义 创建者:Done-0 创建时间:2025-08-05

Jump to

Keyboard shortcuts

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