本文整理匯總了Golang中github.com/robfig/revel.InterceptMethod函數的典型用法代碼示例。如果您正苦於以下問題:Golang InterceptMethod函數的具體用法?Golang InterceptMethod怎麽用?Golang InterceptMethod使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了InterceptMethod函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: init
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
r.InterceptMethod((*XormController).Begin, r.BEFORE)
r.InterceptMethod((*XormController).Commit, r.AFTER)
r.InterceptMethod((*XormController).Rollback, r.FINALLY)
}
示例2: init
func init() {
revel.OnAppStart(models.Init)
revel.OnAppStart(GorpInit)
revel.InterceptMethod((*GorpController).Begin, revel.BEFORE)
revel.InterceptMethod((*GorpController).Commit, revel.AFTER)
revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY)
}
示例3: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*GorpController).Begin, revel.BEFORE)
// revel.InterceptMethod(Application.AddUser, revel.BEFORE)
// revel.InterceptMethod(Hotels.checkUser, revel.BEFORE)
revel.InterceptMethod((*GorpController).Commit, revel.AFTER)
revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY)
}
示例4: init
func init() {
revel.OnAppStart(Init)
yield.DefaultLayout["html"] = "application.html"
revel.InterceptMethod((*GorpController).Begin, revel.BEFORE)
revel.InterceptMethod(Application.AddUser, revel.BEFORE)
revel.InterceptMethod(Hotels.checkUser, revel.BEFORE)
revel.InterceptMethod((*GorpController).Commit, revel.AFTER)
revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY)
}
示例5: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*Qbs).Begin, revel.BEFORE)
revel.InterceptMethod((*Application).inject, revel.BEFORE)
revel.InterceptMethod((*Qbs).End, revel.AFTER)
//注冊模板函數,
//不等於
revel.TemplateFuncs["notEq"] = func(a, b interface{}) bool { return a != b }
revel.TemplateFuncs["dateFormat"] = func(t time.Time) string {
return t.Format("2006-01-02")
}
}
示例6: init
func init() {
revel.OnAppStart(func() {
uploadPath = fmt.Sprintf("%s/public/upload/", revel.BasePath)
})
revel.InterceptMethod((*Application).inject, revel.BEFORE)
}
示例7: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*Application).checkUser, revel.BEFORE)
revel.TemplateFuncs["eqis"] = func(i int64, s string) bool {
return strconv.FormatInt(i, 10) == s
}
}
示例8: init
func init() {
// Seed the random library
rand.Seed(time.Now().UTC().UnixNano())
revel.OnAppStart(Init)
revel.InterceptMethod((*GorpController).Begin, revel.BEFORE)
//revel.InterceptMethod(Application.AddUser, revel.BEFORE)
revel.InterceptMethod(App.AddUser, revel.BEFORE)
revel.InterceptMethod(App.logEntry, revel.BEFORE)
//revel.InterceptMethod(Hotels.checkUser, revel.BEFORE)
revel.InterceptMethod((*GorpController).Commit, revel.AFTER)
revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY)
revel.TemplateFuncs["countryOption"] = getCountryOptions
revel.TemplateFuncs["keyOption"] = getKeyOptions
revel.TemplateFuncs["keyUsageOption"] = getKeyUsageOptions
revel.TemplateFuncs["extKeyUsageOption"] = getExtKeyUsageOptions
}
示例9: init
func init() {
ChatServer = chatserver.NewServer()
ChatServer.RunRooms()
//revel.InterceptMethod(Rooms.CheckUser, revel.BEFORE)
revel.InterceptMethod(Application.AddUser, revel.BEFORE)
revel.TemplateFuncs["ueq"] = func(a, b interface{}) bool { return !(a == b) }
revel.TemplateFuncs["add"] = func(a, b int) int { return a + b }
revel.TemplateFuncs["minus"] = func(a, b int) int { return a - b }
revel.TemplateFuncs["less"] = func(a, b int) bool { return a < b }
}
示例10: init
func init() {
revel.OnAppStart(func() {
revel.WARN.Println("開始執行")
//檢測是否登陸
revel.InterceptMethod(CheckLogin, revel.BEFORE)
//多核運行
np := runtime.NumCPU()
if np >= 2 {
runtime.GOMAXPROCS(np - 1)
}
})
}
示例11: New
func New() {
revel.InterceptMethod((*MgoController).new, revel.BEFORE)
}
示例12: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*CassandraController).Begin, revel.BEFORE)
revel.InterceptMethod((*CassandraController).Finish, revel.AFTER)
}
示例13: init
func init() {
revel.ERROR_CLASS = "error"
revmgo.ControllerInit()
revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
示例14: init
func init() {
revmgo.ControllerInit()
revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
示例15: init
func init() {
revel.OnAppStart(InitDB) // DBやテーブルの作成
revel.InterceptMethod((*GorpController).Begin, revel.BEFORE) // transaction開始
revel.InterceptMethod((*GorpController).Commit, revel.AFTER) // 変更反映
revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY) // 異常時処理
}