jwt_util

package
v0.0.0-...-bd7812a Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenInvalid = errors.New("invalid token")

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

type JwtUtil

type JwtUtil struct {
	SigningKey     []byte
	ExpiresTime    int
	BufferTime     int
	CookieName     string
	CookiePath     string
	CookieDomain   string
	SecurityCookie bool
}

func NewJwtUtil

func NewJwtUtil() *JwtUtil

func (*JwtUtil) CreateClaims

func (j *JwtUtil) CreateClaims(username string) Claims

func (*JwtUtil) CreateToken

func (j *JwtUtil) CreateToken(claims Claims) (string, error)

func (*JwtUtil) CreateTokenByOldToken

func (j *JwtUtil) CreateTokenByOldToken(oldToken string, claims Claims) (string, error)

func (*JwtUtil) ParseToken

func (j *JwtUtil) ParseToken(tokenString string) (*Claims, error)

Jump to

Keyboard shortcuts

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