middleware

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSession

func ClearSession(c *gin.Context)

ClearSession clears all session data

func DeleteSessionValue

func DeleteSessionValue(c *gin.Context, key string)

DeleteSessionValue deletes a value from the session

func GetSession

func GetSession(c *gin.Context) sessions.Session

GetSession returns the session from the context

func GetSessionValue

func GetSessionValue(c *gin.Context, key string) interface{}

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

func SetSessionValue(c *gin.Context, key string, value interface{})

SetSessionValue sets a value in the session

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL