jwtx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJwtToken

func NewJwtToken[V any](opts ...JwtTokenOptions) *jwtToken[V]

NewJwtToken creates a new JWT token

Types

type JwtTokenOptions

type JwtTokenOptions func(*options)

func WithAudience

func WithAudience(audience string) JwtTokenOptions

WithAudience sets the audience for the jwt token

func WithExpired

func WithExpired(expired time.Duration) JwtTokenOptions

WithExpired sets the expired for the jwt token

func WithIssuer

func WithIssuer(issuer string) JwtTokenOptions

WithIssuer sets the issuer for the jwt token

func WithSecretKey

func WithSecretKey(secretKey string) JwtTokenOptions

WithSecretKey sets the secret key for the jwt token The functionx can not be used with WithSecretKeyCallback together

func WithSecretKeyCallback

func WithSecretKeyCallback(callback func() string) JwtTokenOptions

WithSecretKeyCallback sets the secret key for the jwt token by callback. The callback will be called when the secret key is needed. WithSecretKeyCallback can not be used with WithSecretKey together.

func WithSigningMethod

func WithSigningMethod(signingMethod jwt.SigningMethod) JwtTokenOptions

WithSigningMethod sets the signing method for the jwt token

Jump to

Keyboard shortcuts

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