Documentation ¶
Index ¶
- Variables
- func GetClientIP(ctx context.Context) (string, error)
- func GetCtxTokenClaims(ctx context.Context) (*jwt.MapClaims, error)
- func GetCtxTokenClaimsJwtId(ctx context.Context) (string, error)
- func GetCtxTokenClaimsSharedUserId(ctx context.Context) (string, error)
- func GetCtxTokenClaimsUserId(ctx context.Context) (string, error)
- func GetCtxTokenString(ctx context.Context) (string, error)
- func SetCtxTokenClaims(ctx context.Context, claims *jwt.MapClaims) context.Context
- func SetCtxTokenString(ctx context.Context, token string) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MissingTokenError = errors.New("missing token") UnexpectedTokenTypeError = errors.New("unexpected type") MissingTokenClaimsError = errors.New("missing token claims") MissingTokenClaimsUserIdError = errors.New("missing token claims user id") MissingTokenClaimsIdError = errors.New("missing token claims id") UnexpectedTokenClaimsTypeError = errors.New("unexpected token claims type") FailedToGetPeerFromContextError = errors.New("failed to get peer from context") )
Functions ¶
func GetClientIP ¶ added in v0.6.28
GetClientIP extracts the client IP address from the context
func GetCtxTokenClaims ¶
GetCtxTokenClaims gets the token claims from the context
func GetCtxTokenClaimsJwtId ¶ added in v0.6.22
GetCtxTokenClaimsJwtId gets the token claims JWT ID from the context
func GetCtxTokenClaimsSharedUserId ¶ added in v0.6.22
GetCtxTokenClaimsSharedUserId gets the token claims shared user ID from the context
func GetCtxTokenClaimsUserId ¶ added in v0.6.22
GetCtxTokenClaimsUserId gets the token claims user ID from the context
func GetCtxTokenString ¶
GetCtxTokenString gets the token string from the context
func SetCtxTokenClaims ¶
SetCtxTokenClaims sets the token claims to the context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.