Documentation ¶
Index ¶
Constants ¶
View Source
const (
KeyProps = "_conf"
)
Variables ¶
View Source
var StarterRegister *starterRegister = new(starterRegister)
Functions ¶
Types ¶
type BaseStarter ¶
type BaseStarter struct{}
基础空启动器实现 为了方便资源启动器的代码实现
func (*BaseStarter) Init ¶
func (b *BaseStarter) Init(ctx StarterContext)
func (*BaseStarter) Setup ¶
func (b *BaseStarter) Setup(ctx StarterContext)
func (*BaseStarter) Start ¶
func (b *BaseStarter) Start(ctx StarterContext)
func (*BaseStarter) StartBlocking ¶
func (b *BaseStarter) StartBlocking() bool
func (*BaseStarter) Stop ¶
func (b *BaseStarter) Stop(ctx StarterContext)
type BootApplication ¶
type BootApplication struct {
// contains filtered or unexported fields
}
应用程序启动管理器
func New ¶
func New(conf kvs.ConfigSource) *BootApplication
func (*BootApplication) Start ¶
func (b *BootApplication) Start()
func (*BootApplication) Stop ¶
func (b *BootApplication) Stop()
type Initializer ¶
type Initializer interface {
// 用于对象实例化后的初始化操作
Init()
}
初始化接口
func GetApiInitializers ¶
func GetApiInitializers() []Initializer
type Starter ¶
type Starter interface { // 1.系统启动,初始化一些基础资源 Init(StarterContext) // 2.系统基础资源的安装 Setup(StarterContext) // 3.启动基础资源 Start(StarterContext) // 启动器是否可阻塞 StartBlocking() bool // 4.资源停止和销毁 Stop(StarterContext) }
资源启动器接口
func GetStarters ¶
func GetStarters() []Starter
type StarterContext ¶
type StarterContext map[string]interface{}
基础资源上下文
func (StarterContext) Props ¶
func (s StarterContext) Props() kvs.ConfigSource
type WebApiStarter ¶
type WebApiStarter struct {
BaseStarter
}
func (*WebApiStarter) Setup ¶
func (s *WebApiStarter) Setup(ctx StarterContext)
Click to show internal directories.
Click to hide internal directories.