本文整理匯總了Golang中github.com/mjibson/goread/_third_party/github.com/MiniProfiler/go/miniprofiler_gae.Context.Includes方法的典型用法代碼示例。如果您正苦於以下問題:Golang Context.Includes方法的具體用法?Golang Context.Includes怎麽用?Golang Context.Includes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mjibson/goread/_third_party/github.com/MiniProfiler/go/miniprofiler_gae.Context
的用法示例。
在下文中一共展示了Context.Includes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: includes
func includes(c mpg.Context, w http.ResponseWriter, r *http.Request) *Includes {
i := &Includes{
Angular: Angular,
BootstrapCss: BootstrapCss,
BootstrapJs: BootstrapJs,
FontAwesome: FontAwesome,
Jquery: Jquery,
JqueryUI: JqueryUI,
Underscore: Underscore,
MiniProfiler: c.Includes(),
GoogleAnalyticsId: GOOGLE_ANALYTICS_ID,
GoogleAnalyticsHost: GOOGLE_ANALYTICS_HOST,
SubURL: subURL,
IsDev: isDevServer,
/* StripeKey: STRIPE_KEY,
StripePlans: STRIPE_PLANS,*/
}
session, _ := Store.Get(r, "pretlist-session")
i.Session = session
if cu := user.Current(c); cu != nil {
gn := goon.FromContext(c)
user := &User{Id: cu.ID}
if err := gn.Get(user); err == nil {
i.User = user
i.IsAdmin = cu.Admin
if len(user.Messages) > 0 {
i.Messages = user.Messages
user.Messages = nil
gn.Put(user)
}
/*
if _, err := r.Cookie("update-bug"); err != nil {
i.Messages = append(i.Messages, "Go Read had some problems updating feeds. It may take a while for new stories to appear again. Sorry about that.")
http.SetCookie(w, &http.Cookie{
Name: "update-bug",
Value: "done",
Expires: time.Now().Add(time.Hour * 24 * 7),
})
}
*/
}
}
return i
}