utils

package
v0.0.43 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse added in v0.0.42

func ErrorResponse(ctx *gin.Context, status int, message string)

GetTokenFromContext retrieves the token from the context

func GetTokenFromContext

func GetTokenFromContext(ctx *gin.Context) (models.Token, error)

retrieve authorization token from the gin context sources hierarchy is: 1. authorization header 2. main website's authorization cookie 3. subdomains' authorization cookie

func GetUIntParamFromContext added in v0.0.42

func GetUIntParamFromContext(ctx *gin.Context, paramName string) (uint, error)

func GetUserFromContext

func GetUserFromContext(ctx *gin.Context) (models.User, error)

get the current user from the request context

Types

This section is empty.

Jump to

Keyboard shortcuts

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