Documentation
¶
Index ¶
- func ClearSession(c *gin.Context)
- func DeleteSessionValue(c *gin.Context, key string)
- func GetSession(c *gin.Context) sessions.Session
- func GetSessionValue(c *gin.Context, key string) interface{}
- func NewSessionMiddleware(cfg config.Config) gin.HandlerFunc
- func RequireAdmin() gin.HandlerFunc
- func RequireAuth(jwtService jwt.JWTServiceInterface) gin.HandlerFunc
- func RequireRole(role string) gin.HandlerFunc
- func SetSessionValue(c *gin.Context, key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSessionValue ¶
DeleteSessionValue deletes a value from the session
func GetSession ¶
GetSession returns the session from the context
func GetSessionValue ¶
GetSessionValue gets a value from the session
func NewSessionMiddleware ¶
func NewSessionMiddleware(cfg config.Config) gin.HandlerFunc
NewSessionMiddleware creates and returns a session middleware
func RequireAdmin ¶
func RequireAdmin() gin.HandlerFunc
RequireStaff middleware ensures user has staff privileges
func RequireAuth ¶
func RequireAuth(jwtService jwt.JWTServiceInterface) gin.HandlerFunc
RequireAuth ensures a user is signed in using JWT token
func RequireRole ¶
func RequireRole(role string) gin.HandlerFunc
RequireRole checks that the current user has the given role (legacy compatibility)
func SetSessionValue ¶
SetSessionValue sets a value in the session
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.