當前位置: 首頁>>代碼示例>>Golang>>正文


Golang revel.InterceptMethod函數代碼示例

本文整理匯總了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)
}
開發者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


注:本文中的github.com/robfig/revel.InterceptMethod函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。