func driverInfoFromConfig() (driver, spec string) { driver = utils.ForceGetConfig("db.driver") log.Println("db driver:", driver) spec = utils.ForceGetConfig("db.spec") log.Println("db sepc:", hidePassword(spec)) return }
func initRevelTemplateFuncs() { revel.TemplateFuncs["webTitle"] = func(prefix string) (webTitle string) { const KEY = "cache.web.title" if err := cache.Get(KEY, &webTitle); err != nil { webTitle = utils.ForceGetConfig("web.title") go cache.Set(KEY, webTitle, 24*30*time.Hour) } return } revel.TemplateFuncs["logined"] = func(session revel.Session) bool { v, e := session["user"] return e == true && v != "" } }