Documentation
¶
Index ¶
- func GetCtxAccessToken(ctx *gin.Context) (string, error)
- func GetCtxAccessTokenClaims(ctx *gin.Context) (jwt.MapClaims, error)
- func GetCtxRefreshToken(ctx *gin.Context) (string, error)
- func GetCtxRefreshTokenClaims(ctx *gin.Context) (jwt.MapClaims, error)
- func GetCtxToken(ctx *gin.Context, key string) (string, error)
- func GetCtxTokenClaims(ctx *gin.Context, key string) (jwt.MapClaims, error)
- func SetCtxAccessToken(ctx *gin.Context, token string)
- func SetCtxAccessTokenClaims(ctx *gin.Context, claims jwt.MapClaims)
- func SetCtxRefreshToken(ctx *gin.Context, token string)
- func SetCtxRefreshTokenClaims(ctx *gin.Context, claims jwt.MapClaims)
- func SetCtxToken(ctx *gin.Context, key, token string)
- func SetCtxTokenClaims(ctx *gin.Context, key string, claims jwt.MapClaims)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCtxAccessToken ¶ added in v0.5.3
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
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
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
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
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 ¶
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
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
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
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
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
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 ¶
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.