plugin

package
v0.0.0-...-b9f283a Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: AGPL-3.0 Imports: 8 Imported by: 10

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 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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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