Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSMSRequestError = errors.New("sms request error")
ErrSMSRequestError SMS请求出错
Functions ¶
Types ¶
type Module ¶
type Module interface { MiraiGoModule() ModuleInfo // Init 初始化 // 待所有 Module 初始化完成后 // 进行服务注册 Serve Init() // PostInit 第二次初始化 // 调用该函数时,所有 Module 都已完成第一段初始化过程 // 方便进行跨Module调用 PostInit() // Serve 向Bot注册服务函数 // 结束后调用 Start Serve(bot *Bot) // Start 启用Module // 此处调用为 // “` go // go Start() // “` // 结束后进行登录 Start(bot *Bot) // Stop 应用结束时对所有 Module 进行通知 // 在此进行资源回收 Stop(bot *Bot, wg *sync.WaitGroup) }
Module MiraiGo 中的模块 用于进行模块化设计
type ModuleInfo ¶
ModuleInfo 模块信息
func GetModule ¶
func GetModule(name string) (ModuleInfo, error)
GetModule - 获取一个已注册的 Module 的 ModuleInfo
func (ModuleInfo) String ¶
func (mi ModuleInfo) String() string
Click to show internal directories.
Click to hide internal directories.