Documentation ¶
Index ¶
- type Session
- func (s *Session) GetFlashes(r *http.Request, w http.ResponseWriter) ([]string, error)
- func (s *Session) GetUser(r *http.Request) (*models.User, error)
- func (s *Session) SaveFlash(message string, r *http.Request, w http.ResponseWriter) error
- func (s *Session) SaveUser(u *models.User, r *http.Request, w http.ResponseWriter) error
- type TopicalSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a struct which wraps a gorilla/sessions CookieStore and implements a few methods used for retrieval and storage of session items.
func NewSession ¶
NewSession returns a new session instance, based on a provided key
func (*Session) GetFlashes ¶
GetFlashes returns all flash messages stored in the session. Note that the way flash messages work they are deleted after being retrieved.
type TopicalSession ¶
type TopicalSession interface { GetUser(r *http.Request) (*models.User, error) SaveUser(u *models.User, r *http.Request, w http.ResponseWriter) error SaveFlash(message string, r *http.Request, w http.ResponseWriter) error GetFlashes(r *http.Request, w http.ResponseWriter) ([]string, error) }
TopicalSession implements methods necessary to save and retrieve users/flash messages
Click to show internal directories.
Click to hide internal directories.