context

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthTokenID

func GetAuthTokenID(c *gin.Context) string

GetAuthTokenID : returns the auth token ID from a request.

func GetAuthTokenLastUpdate

func GetAuthTokenLastUpdate(c *gin.Context) time.Time

GetAuthTokenLastUpdate : returns the last update of the auth token from a request.

func GetLocale

func GetLocale(c *gin.Context) string

GetLocale : returns the locale from the context.

func GetPageKey

func GetPageKey(c *gin.Context) string

GetPageKey : returns the unique key of the target page from the context.

func GetUserID

func GetUserID(c *gin.Context) string

GetUserID : returns the user ID from a request.

func IsUserAuthenticated

func IsUserAuthenticated(c *gin.Context) bool

IsUserAuthenticated : returns true if the userID is defined into the JWT token.

func SaveAuthToken

func SaveAuthToken(cookieName, secret string) gin.HandlerFunc

SaveAuthToken : returns a middleware which saves the auth token from the request to the context.

func SaveLocale

func SaveLocale(contextLocale string) gin.HandlerFunc

SaveLocale : saves the locale of the target page to the context.

func SavePageKey

func SavePageKey(pageKey string) gin.HandlerFunc

SavePageKey : saves the unique key of the target page to the context.

func SaveUnknownLocale

func SaveUnknownLocale(supportedLocales []string, defaultLocale string) gin.HandlerFunc

SaveUnknownLocale : saves the locale of the target page to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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