Documentation ¶
Index ¶
- Constants
- func RequireUser(next http.Handler) http.Handler
- func Set(config Config) func(http.Handler) http.Handler
- func SetNav(nav string) func(http.Handler) http.Handler
- type Config
- type Ctx
- func (c *Ctx) AssetPath(asset string) string
- func (c *Ctx) HandleError(w http.ResponseWriter, r *http.Request, err error)
- func (c *Ctx) PathTo(name string, pairs ...string) *url.URL
- func (c *Ctx) PersistFlash(w http.ResponseWriter, f flash.Flash)
- func (c *Ctx) URLTo(name string, pairs ...string) *url.URL
Constants ¶
View Source
const ( UserIDKey = "user_id" OriginalUserIDKey = "original_user_id" UserRoleKey = "user_role" OriginalUserRoleKey = "original_user_role" FlashCookiePrefix = "flash" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ctx ¶
type Ctx struct { Config Log *zap.SugaredLogger Loc *gotext.Locale User *models.Person UserRole string OriginalUser *models.Person Flash []flash.Flash CSRFToken string CSPNonce string // contains filtered or unexported fields }
func (*Ctx) HandleError ¶
func (*Ctx) PersistFlash ¶
func (c *Ctx) PersistFlash(w http.ResponseWriter, f flash.Flash)
Click to show internal directories.
Click to hide internal directories.