Documentation ¶
Index ¶
- Constants
- func IsValidCSRF(r *http.Request) bool
- func SaveCaptcha(w http.ResponseWriter, r *http.Request) *http.Request
- func SaveCsrf(w http.ResponseWriter, r *http.Request) *http.Request
- func Set(ctx context.Context, s Session) context.Context
- type Data
- type Session
- type SessionContext
- func (s *SessionContext) CustomFlash(m string) *SessionContext
- func (s *SessionContext) FailFlash(m string) *SessionContext
- func (s *SessionContext) Save(ctx context.Context, w http.ResponseWriter)
- func (s *SessionContext) SuccessFlash(m string) *SessionContext
- func (s *SessionContext) VerifyCaptchaSolution(r *http.Request) bool
Constants ¶
View Source
const MaxAge = 60 * 60 * 24 * 365 * 5
Variables ¶
This section is empty.
Functions ¶
func IsValidCSRF ¶
func SaveCaptcha ¶
Types ¶
type Data ¶
type Data struct { TimeoutAt time.Time `json:",omitempty"` USER string `json:",omitempty"` LastSeen time.Time `json:",omitempty"` LoggedIn bool `json:",omitempty"` Captcha string `json:",omitempty"` Csrf string `json:",omitempty"` LoginDest string `json:",omitempty"` Flash *flash.Flash `json:",omitempty"` }
type SessionContext ¶
type SessionContext struct { Data Data // contains filtered or unexported fields }
func (*SessionContext) CustomFlash ¶ added in v0.0.13
func (s *SessionContext) CustomFlash(m string) *SessionContext
func (*SessionContext) FailFlash ¶
func (s *SessionContext) FailFlash(m string) *SessionContext
func (*SessionContext) Save ¶
func (s *SessionContext) Save(ctx context.Context, w http.ResponseWriter)
func (*SessionContext) SuccessFlash ¶
func (s *SessionContext) SuccessFlash(m string) *SessionContext
func (*SessionContext) VerifyCaptchaSolution ¶
func (s *SessionContext) VerifyCaptchaSolution(r *http.Request) bool
Click to show internal directories.
Click to hide internal directories.