Documentation ¶
Index ¶
- func CurrentGuest(c *gin.Context) *gin.H
- func CurrentParty(c *gin.Context) (*models.Party, error)
- func CurrentUser(c *gin.Context) *models.User
- func IsGuest(c *gin.Context) bool
- func IsLoggedIn(c *gin.Context) bool
- func Middleware(store cache.Store) gin.HandlerFunc
- type Session
- func (s *Session) Delete(key string) error
- func (s *Session) Error() (string, error)
- func (s *Session) Flash(key string, value string)
- func (s *Session) Flashes(key ...string) ([]string, error)
- func (s *Session) Get(key string) (string, error)
- func (s *Session) Logout() error
- func (s *Session) Set(key string, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentGuest ¶
CurrentGuest shortcut to get the current session's guest
func CurrentParty ¶
CurrentParty shortcut to get the current session's party
func CurrentUser ¶
CurrentUser shortcut to get the current session's user
func IsLoggedIn ¶
IsLoggedIn checks if a user is logged in to the session
func Middleware ¶
func Middleware(store cache.Store) gin.HandlerFunc
Middleware creates the Party session middleware
Types ¶
type Session ¶
type Session struct { ID string // contains filtered or unexported fields }
Session is a hella simple string value session store for party-server
func DefaultSession ¶
DefaultSession shortcut to get the session
Click to show internal directories.
Click to hide internal directories.