本文整理汇总了Golang中github.com/robfig/revel.InterceptMethod函数的典型用法代码示例。如果您正苦于以下问题:Golang InterceptMethod函数的具体用法?Golang InterceptMethod怎么用?Golang InterceptMethod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InterceptMethod函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
}
开发者ID:jijeshmohan,项目名称:go-url-shortener,代码行数:7,代码来源:init.go
示例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)
}
开发者ID:Chandler,项目名称:goflesh,代码行数:7,代码来源:app.go
示例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)
}
开发者ID:pombredanne,项目名称:goqdb,代码行数:8,代码来源:init.go
示例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)
}
开发者ID:hura,项目名称:yield,代码行数:10,代码来源:init.go
示例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")
}
}
开发者ID:river-lee,项目名称:qishare,代码行数:15,代码来源:init.go
示例6: init
func init() {
revel.OnAppStart(func() {
uploadPath = fmt.Sprintf("%s/public/upload/", revel.BasePath)
})
revel.InterceptMethod((*Application).inject, revel.BEFORE)
}
开发者ID:jsli,项目名称:gorevel,代码行数:7,代码来源:init.go
示例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
}
}
开发者ID:zeuson,项目名称:gorevel,代码行数:8,代码来源:init.go
示例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
}
开发者ID:shaheemirza,项目名称:CAGo,代码行数:19,代码来源:init.go
示例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 }
}
开发者ID:supermouseno1,项目名称:webchat,代码行数:12,代码来源:init.go
示例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)
}
})
}
开发者ID:jsli,项目名称:GoCMS,代码行数:15,代码来源:init.go
示例11: New
func New() {
revel.InterceptMethod((*MgoController).new, revel.BEFORE)
}
开发者ID:nrempel,项目名称:revelmgo,代码行数:3,代码来源:revelmgo.go
示例12: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*CassandraController).Begin, revel.BEFORE)
revel.InterceptMethod((*CassandraController).Finish, revel.AFTER)
}
开发者ID:kevwil,项目名称:go-blog-cassandra,代码行数:5,代码来源:init.go
示例13: init
func init() {
revel.ERROR_CLASS = "error"
revmgo.ControllerInit()
revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
开发者ID:netsharec,项目名称:ironzebra,代码行数:5,代码来源:init.go
示例14: init
func init() {
revmgo.ControllerInit()
revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
开发者ID:relvinhas,项目名称:ironzebra,代码行数:4,代码来源:init.go
示例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) // 異常時処理
}
开发者ID:matsumatsu20,项目名称:furin_api,代码行数:6,代码来源:init.go
示例16: init
func init() {
revel.InterceptMethod(Radio.LogVisitorByIP, revel.BEFORE)
revel.InterceptMethod((*Radio).Prepare, revel.BEFORE)
}
开发者ID:jsli,项目名称:ota,代码行数:4,代码来源:radio.go
示例17: init
func init() {
revmgo.ControllerInit()
revel.InterceptMethod((*Application).Setup, revel.BEFORE)
}
开发者ID:argentum47,项目名称:Fio,代码行数:4,代码来源:init.go
示例18: init
func init() {
revel.InterceptMethod((*MgoController).close, revel.FINALLY)
}
开发者ID:nrempel,项目名称:revelmgo,代码行数:3,代码来源:revelmgo.go
示例19: Clone
func Clone() {
revel.InterceptMethod((*MgoController).clone, revel.BEFORE)
}
开发者ID:nrempel,项目名称:revelmgo,代码行数:3,代码来源:revelmgo.go
示例20: init
func init() {
revel.OnAppStart(Init)
revel.InterceptMethod((*ModelController).Begin, revel.BEFORE)
}
开发者ID:souravray,项目名称:ToGo,代码行数:4,代码来源:init.go
注:本文中的github.com/robfig/revel.InterceptMethod函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论