jwt

package
v2.6.27 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jwt

type Jwt struct {
	Key                 []byte
	TokenExpireDuration time.Duration
}

func NewJwt

func NewJwt(key string, tokenExpireDuration time.Duration) *Jwt

func (*Jwt) GenerateToken

func (s *Jwt) GenerateToken(userId uint) string

func (*Jwt) ParseToken

func (s *Jwt) ParseToken(tokenString string) (uint, error)

type UserClaims

type UserClaims struct {
	UserId uint `json:"user_id"`
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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