context

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCtxAccessToken added in v0.5.3

func GetCtxAccessToken(ctx *gin.Context) (string, error)

GetCtxAccessToken tries to get the raw access token from the context

Parameters:

  • ctx: The gin context

Returns:

  • string: The raw access token from the context
  • error: An error if the access token is not found or of an unexpected type

func GetCtxAccessTokenClaims added in v0.5.3

func GetCtxAccessTokenClaims(ctx *gin.Context) (jwt.MapClaims, error)

GetCtxAccessTokenClaims tries to get the access token claims from the context

Parameters:

  • ctx: The gin context

Returns:

  • jwt.MapClaims: The access token claims from the context
  • error: An error if the access token claims are not found or of an unexpected type

func GetCtxRefreshToken added in v0.5.3

func GetCtxRefreshToken(ctx *gin.Context) (string, error)

GetCtxRefreshToken tries to get the raw refresh token from the context

Parameters:

  • ctx: The gin context

Returns:

  • string: The raw refresh token from the context
  • error: An error if the refresh token is not found or of an unexpected type

func GetCtxRefreshTokenClaims added in v0.5.3

func GetCtxRefreshTokenClaims(ctx *gin.Context) (jwt.MapClaims, error)

GetCtxRefreshTokenClaims tries to get the refresh token claims from the context

Parameters:

  • ctx: The gin context

Returns:

  • jwt.MapClaims: The refresh token claims from the context
  • error: An error if the refresh token claims are not found or of an unexpected type

func GetCtxToken added in v0.5.1

func GetCtxToken(ctx *gin.Context, key string) (string, error)

GetCtxToken tries to get the raw token from the context

Parameters:

  • ctx: The gin context
  • key: The key to get the token from

Returns:

  • string: The raw token from the context
  • error: An error if the token is not found or of an unexpected type

func GetCtxTokenClaims

func GetCtxTokenClaims(ctx *gin.Context, key string) (jwt.MapClaims, error)

GetCtxTokenClaims tries to get the token claims from the context

Parameters:

  • ctx: The gin context
  • key: The key to get the claims from

Returns:

  • jwt.MapClaims: The token claims from the context
  • error: An error if the token claims are not found or of an unexpected type

func SetCtxAccessToken added in v0.5.3

func SetCtxAccessToken(ctx *gin.Context, token string)

SetCtxAccessToken sets the raw access token in the context

Parameters:

  • ctx: The gin context
  • token: The raw access token to set in the context

func SetCtxAccessTokenClaims added in v0.5.3

func SetCtxAccessTokenClaims(ctx *gin.Context, claims jwt.MapClaims)

SetCtxAccessTokenClaims sets the access token claims in the context

Parameters:

  • ctx: The gin context
  • claims: The access token claims to set in the context

func SetCtxRefreshToken added in v0.5.3

func SetCtxRefreshToken(ctx *gin.Context, token string)

SetCtxRefreshToken sets the raw refresh token in the context

Parameters:

  • ctx: The gin context
  • token: The raw refresh token to set in the context

func SetCtxRefreshTokenClaims added in v0.5.3

func SetCtxRefreshTokenClaims(ctx *gin.Context, claims jwt.MapClaims)

SetCtxRefreshTokenClaims sets the refresh token claims in the context

Parameters:

  • ctx: The gin context
  • claims: The refresh token claims to set in the context

func SetCtxToken added in v0.5.1

func SetCtxToken(ctx *gin.Context, key, token string)

SetCtxToken sets the raw token in the context

Parameters:

  • ctx: The gin context
  • key: The key to set the token under
  • token: The raw token to set in the context

func SetCtxTokenClaims

func SetCtxTokenClaims(ctx *gin.Context, key string, claims jwt.MapClaims)

SetCtxTokenClaims sets the token claims in the context

Parameters:

  • ctx: The gin context
  • key: The key to set the claims under
  • claims: The token claims to set in 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