本文整理匯總了Golang中github.com/opesun/hypecms/api/context.Uni.Secret方法的典型用法代碼示例。如果您正苦於以下問題:Golang Uni.Secret方法的具體用法?Golang Uni.Secret怎麽用?Golang Uni.Secret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/opesun/hypecms/api/context.Uni
的用法示例。
在下文中一共展示了Uni.Secret方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: RegLoginBuild
// Helper function to hotregister a guest user, log him in and build his user data into uni.Dat["_user"].
func RegLoginBuild(uni *context.Uni, solved_puzzle bool) error {
db := uni.Db
ev := uni.Ev
guest_rules := guestRules(uni)
inp := uni.Req.Form
http_header := uni.Req.Header
dat := uni.Dat
w := uni.W
block_key := []byte(uni.Secret())
guest_id, err := user_model.RegisterGuest(db, ev, guest_rules, inp, solved_puzzle)
if err != nil {
return err
}
err = user_model.Login(w, guest_id, block_key)
if err != nil {
return err
}
user, err := user_model.BuildUser(db, ev, guest_id, http_header)
if err != nil {
return err
}
dat["_user"] = user
return nil
}
示例2: showTimer
func showTimer(uni *context.Uni, puzzle_opt map[string]interface{}) (string, error) {
return user_model.ShowTimer(uni.Secret(), puzzle_opt)
}
示例3: solveTimer
func solveTimer(uni *context.Uni, puzzle_opts map[string]interface{}) error {
return user_model.SolveTimer(uni.Secret(), uni.Req.Form, puzzle_opts)
}