Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWTAuth ¶
type JWTAuth struct {
// contains filtered or unexported fields
}
JWTAuth - jwt Authenticate
func (*JWTAuth) DestroyToken ¶
DestroyToken - Destroy token
func (*JWTAuth) GenerateToken ¶
GenerateToken - Generate token
func (*JWTAuth) ParseUserUUID ¶
ParseUserUUID - Resolve user UUID
type Option ¶
type Option func(*options)
Option - Defining parameter items
func SetExpired ¶
SetExpired - Set the token expiration time (in seconds, default 7200)
func SetKeyfunc ¶
SetKeyfunc - Set the callback function of the verification key
func SetSigningMethod ¶
func SetSigningMethod(method jwt.SigningMethod) Option
SetSigningMethod - Set signature method
type Storer ¶
type Storer interface { // Store token data and specify expiration time Set(ctx context.Context, tokenString string, expiration time.Duration) error // Check if the token exists Check(ctx context.Context, tokenString string) (bool, error) // Close storage Close() error }
Storer - Token storage interface
Click to show internal directories.
Click to hide internal directories.