app_jwt

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	UserID int64  `json:"user_id"`
	Email  string `json:"email"`
}

type JWT

type JWT struct {
	// contains filtered or unexported fields
}

func NewJWT

func NewJWT(cfg config.JWTConfig, redis app_redis.Redis) *JWT

func (*JWT) GenerateToken

func (j *JWT) GenerateToken(ctx context.Context, request PayloadToken) (token string, err error)

func (*JWT) IsTokenRevoked

func (j *JWT) IsTokenRevoked(ctx context.Context, token string) bool

func (*JWT) RevokeToken

func (j *JWT) RevokeToken(ctx context.Context, token string, expiration time.Duration) error

func (*JWT) ValidateToken

func (j *JWT) ValidateToken(c echo.Context, token string) error

type PayloadToken

type PayloadToken struct {
	Data *Data `json:"data"`
	jwt.StandardClaims
}

func NewTokenInformation

func NewTokenInformation(ctx echo.Context) (*PayloadToken, error)

Jump to

Keyboard shortcuts

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