package
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Feb 23, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
boot-starter
通用的 Go 程序启动器框架。
type MyApp struct {
}
func (app *MyApp) Start() {
fmt.Println("app start")
}
func (app *MyApp) ShutDown() {
fmt.Println("app shutdown")
}
func TestBootStarter(t *testing.T) {
go func() {
defer fmt.Println("go stop")
fmt.Println("go start")
time.Sleep(200 * time.Millisecond)
BootStarter.Exit()
}()
BootStarter.Run(new(MyApp))
}
Documentation
¶
type AppRunner interface {
Start()
ShutDown()
}
AppRunner 应用执行器
Source Files
¶
Click to show internal directories.
Click to hide internal directories.