Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "SAGOO_PLUGIN",
MagicCookieValue: "sagoo_plugin",
}
HandshakeConfig 握手配置,插件进程和宿主机进程,都需要保持一致
Functions ¶
func OutJsonRes ¶
OutJsonRes 输出json字符串结果
Types ¶
type Protocol ¶
type Protocol interface { Info(args string) model.PluginInfo Encode(args string) model.JsonRes Decode(data model.DataReq) model.JsonRes }
Protocol RPC协议解析插件接口
type ProtocolRPC ¶
ProtocolRPC 基于RPC实现
func (*ProtocolRPC) Info ¶
func (p *ProtocolRPC) Info(args string) model.PluginInfo
type ProtocolRPCServer ¶
type ProtocolRPCServer struct { // 内嵌业务接口 // 插件进程会将实现业务接口的对象赋值给Impl Impl Protocol }
ProtocolRPCServer GreeterRPC的RPC服务器,符合 net/rpc的要求
func (*ProtocolRPCServer) Encode ¶
func (s *ProtocolRPCServer) Encode(args string, resp *model.JsonRes) error
func (*ProtocolRPCServer) Info ¶
func (s *ProtocolRPCServer) Info(args string, resp *model.PluginInfo) error
Click to show internal directories.
Click to hide internal directories.