예제 #1
0
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
0
파일: app.go 프로젝트: Chandler/goflesh
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
0
파일: init.go 프로젝트: pombredanne/goqdb
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
0
파일: init.go 프로젝트: hura/yield
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
0
파일: init.go 프로젝트: river-lee/qishare
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
0
파일: init.go 프로젝트: jsli/gorevel
func init() {
	revel.OnAppStart(func() {
		uploadPath = fmt.Sprintf("%s/public/upload/", revel.BasePath)
	})

	revel.InterceptMethod((*Application).inject, revel.BEFORE)
}
예제 #7
0
파일: init.go 프로젝트: zeuson/gorevel
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
0
파일: init.go 프로젝트: shaheemirza/CAGo
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
0
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
0
파일: init.go 프로젝트: jsli/GoCMS
func init() {

	revel.OnAppStart(func() {
		revel.WARN.Println("开始执行")

		//检测是否登陆
		revel.InterceptMethod(CheckLogin, revel.BEFORE)

		//多核运行
		np := runtime.NumCPU()
		if np >= 2 {
			runtime.GOMAXPROCS(np - 1)
		}
	})
}
예제 #11
0
func New() {
	revel.InterceptMethod((*MgoController).new, revel.BEFORE)
}
예제 #12
0
func init() {
	revel.OnAppStart(Init)
	revel.InterceptMethod((*CassandraController).Begin, revel.BEFORE)
	revel.InterceptMethod((*CassandraController).Finish, revel.AFTER)
}
예제 #13
0
파일: init.go 프로젝트: netsharec/ironzebra
func init() {
	revel.ERROR_CLASS = "error"
	revmgo.ControllerInit()
	revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
예제 #14
0
파일: init.go 프로젝트: relvinhas/ironzebra
func init() {
	revmgo.ControllerInit()
	revel.InterceptMethod(Admin.checkUser, revel.BEFORE)
}
예제 #15
0
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) // 異常時処理
}
예제 #16
0
파일: radio.go 프로젝트: jsli/ota
func init() {
	revel.InterceptMethod(Radio.LogVisitorByIP, revel.BEFORE)
	revel.InterceptMethod((*Radio).Prepare, revel.BEFORE)
}
예제 #17
0
파일: init.go 프로젝트: argentum47/Fio
func init() {
	revmgo.ControllerInit()
	revel.InterceptMethod((*Application).Setup, revel.BEFORE)
}
예제 #18
0
func init() {
	revel.InterceptMethod((*MgoController).close, revel.FINALLY)
}
예제 #19
0
func Clone() {
	revel.InterceptMethod((*MgoController).clone, revel.BEFORE)
}
예제 #20
0
파일: init.go 프로젝트: souravray/ToGo
func init() {
	revel.OnAppStart(Init)
	revel.InterceptMethod((*ModelController).Begin, revel.BEFORE)
}
예제 #21
0
파일: app.go 프로젝트: jsli/ota
func init() {
	revel.InterceptMethod(App.Maintenance, revel.BEFORE)
}
예제 #22
0
// init is called when the first request into the controller is made
func init() {
	revel.InterceptMethod((*Buoy).Before, revel.BEFORE)
	revel.InterceptMethod((*Buoy).After, revel.AFTER)
	revel.InterceptMethod((*Buoy).Panic, revel.PANIC)
}
예제 #23
0
파일: app.go 프로젝트: BYVoid/byvnotes
func init() {
	revel.InterceptMethod(Application.checkUser, revel.BEFORE)
}
예제 #24
0
func init() {
	revel.InterceptMethod((*Docker).Begin, revel.BEFORE)
}
예제 #25
0
func Copy() {
	revel.InterceptMethod((*MgoController).copy, revel.BEFORE)
}
예제 #26
0
파일: revmgo.go 프로젝트: hura/revmgo
func ControllerInit() {
	revel.InterceptMethod((*MongoController).Begin, revel.BEFORE)
	revel.InterceptMethod((*MongoController).End, revel.FINALLY)
}
예제 #27
0
파일: db.go 프로젝트: huaguzi/revel
func init() {
	revel.InterceptMethod((*Transactional).Begin, revel.BEFORE)
	revel.InterceptMethod((*Transactional).Commit, revel.AFTER)
	revel.InterceptMethod((*Transactional).Rollback, revel.FINALLY)
}