Documentation
¶
Index ¶
Constants ¶
View Source
const ( Type_Plugin = "Plugin" //插件对象 Type_Topic = "Topic" //主题对象 Type_Service = "Service" //主体对象,名称可忽略 Type_Other = "Other" //其他对象,预留 )
发送者和接收者的值为json格式,格式如下:
View Source
const ( Command_Exit = "Service.Exit" //退出系统 Command_RegTopic = "Service.RegTopic" //执行主题命令,注册和反注册 Command_Result = "Service.ExecuteResult" //执行来自于UDP传送过来的命令 Command_TransPlugin = "Service.TransPlugin" //执行插件命令 Command_Service = "Service.ExecuteService" //执行主体命令 Command_DB = "Service.ExecuteDB" //执行数据库命令 Command_Log = "Service.Log" //日志命令 )
Variables ¶
This section is empty.
Functions ¶
func GetMessageID ¶
func GetMessageID() uint64
Types ¶
type Plugin ¶
type Plugin interface {
// 初始化插件,带入插件消息通道,该通道由服务框架创建,各插件调用
Init(obj *AppObj) error
// 启动插件
Start() error
// 停止插件
Stop() error
// 获取插件元信息
Meta() *PluginMeta
//接收消息,插件内部传送消息
Receiver(*PluginMsg)
}
Plugin 定义插件标准接口
type PluginMeta ¶
PluginMeta 插件元数据
func NewPluginMeta ¶
func NewPluginMeta(name, version, author string) *PluginMeta
Click to show internal directories.
Click to hide internal directories.