tank/code/core/context.go
2019-05-04 23:36:05 +08:00

28 lines
525 B
Go

package core
import (
"github.com/eyebluecn/tank/code/tool/cache"
"github.com/jinzhu/gorm"
"net/http"
)
type Context interface {
http.Handler
//get the gorm.DB. all the db connection will use this
GetDB() *gorm.DB
GetBean(bean Bean) Bean
//get the global session cache
GetSessionCache() *cache.Table
GetControllerMap() map[string]Controller
//when application installed. this method will invoke every bean's Bootstrap method
InstallOk()
//this method will invoke every bean's Cleanup method
Cleanup()
}