Documentation ¶
Index ¶
- Constants
- type ApiHandler
- type ELogLevel
- type NoticeHandler
- type QBasePlugin
- func (plugin *QBasePlugin) Init() error
- func (plugin *QBasePlugin) Invoke(route string, args map[string]interface{}) (interface{}, error)
- func (plugin *QBasePlugin) Logger() QLogger
- func (plugin *QBasePlugin) RegBus(bus QBus)
- func (plugin *QBasePlugin) SendNotice(topic string, isSync bool, arg interface{}) error
- func (plugin *QBasePlugin) Stop() error
- type QBus
- type QLogger
- type QPlugin
Constants ¶
View Source
const ( ELogLevelDebug = 1 ELogLevelInfo = 2 ELogLevelWarn = 4 ELogLevelError = 8 ELogLevelFatal = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiHandler ¶
注册相关函数定义
type QBasePlugin ¶
type QBasePlugin struct { QPlugin // contains filtered or unexported fields }
func (*QBasePlugin) Init ¶
func (plugin *QBasePlugin) Init() error
func (*QBasePlugin) Invoke ¶
func (plugin *QBasePlugin) Invoke(route string, args map[string]interface{}) (interface{}, error)
func (*QBasePlugin) Logger ¶
func (plugin *QBasePlugin) Logger() QLogger
func (*QBasePlugin) RegBus ¶
func (plugin *QBasePlugin) RegBus(bus QBus)
func (*QBasePlugin) SendNotice ¶
func (plugin *QBasePlugin) SendNotice(topic string, isSync bool, arg interface{}) error
func (*QBasePlugin) Stop ¶
func (plugin *QBasePlugin) Stop() error
type QBus ¶
type QBus interface { //Plug 接入插件 Plug(QPlugin) []error Invoke(route string, args map[string]interface{}) (interface{}, error) SendNotice(topic string, isSync bool, arg interface{}) error Logger() QLogger }
QBus @Description: 总线接口
type QPlugin ¶
type QPlugin interface { //RegBus 注册总线 RegBus(QBus) //Apis 向总线提供API声明 Apis() map[string]ApiHandler //Subscribes 向总线提供消息订阅声明 Subscribes() map[string]NoticeHandler Init() error Stop() error //GetId 向总线提供业务唯一编号 自动化测试和log需求 GetId() string //Invoke 调用总线上的业务方法 Invoke(route string, args map[string]interface{}) (interface{}, error) //SendNotice 向总线上的业务方法 SendNotice(topic string, isSync bool, arg interface{}) error Logger() QLogger }
QPlugin @Description: 插件接口
Click to show internal directories.
Click to hide internal directories.