Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "onebot-plus",
MagicCookieValue: "onebot-plus",
}
View Source
var PluginMap = map[string]plugin.Plugin{ "onebot_grpc": &OnebotGRPCPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
func OnebotPluginBuilder ¶
func OnebotPluginBuilder() *onebotPluginBuilder
Types ¶
type OnebotClientStub ¶
type OnebotClientStub struct {
base.OnebotPluginBaseClientStub
event.OnebotEventCallbackClientStub
}
type OnebotGRPCPlugin ¶
type OnebotGRPCPlugin struct {
// 需要嵌入插件接口
plugin.Plugin
// 具体实现,仅当业务接口实现基于Go时该字段有用
Impl OnebotInterface
}
完整插件对象
func (*OnebotGRPCPlugin) GRPCClient ¶
func (p *OnebotGRPCPlugin) GRPCClient( ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn, ) (interface{}, error)
插件实现GRPC的接口
func (*OnebotGRPCPlugin) GRPCServer ¶
func (p *OnebotGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
插件实现GRPC的接口
type OnebotInterface ¶
type OnebotInterface interface {
base.OnebotPluginBase
event.OnebotEventCallBackInterface
}
type OnebotServerStub ¶
type OnebotServerStub struct {
base.OnebotPluginBaseServerStub
event.OnebotEventCallbackServerStub
}
Click to show internal directories.
Click to hide internal directories.