启动引导
如何实现
// Initiator 初始化需要实现的方法
type Initiator interface {
// 启动
Start() error
// 停止
Stop()
}
Bootstrap
import "github.com/asjard/asjard/core/bootstrap"
type CustomeBootstrap struct{}
// 系统初始化后会执行如下方法
func(CustomeBootstrap) Start() error {return nil}
// 系统停止后会执行如下方法
func(CustomeBootstrap) Stop() {}
func init() {
// 添加到启动引导队列
bootstrap.AddBootstrap(&CustomeBootstrap{})
}Initiator
最后更新于