jwt

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HOURS = "hours"
View Source
const HS256 string = "HS256"
View Source
const MINUTES = "minutes"
View Source
const RS256 string = "RS256"
View Source
const SECONDS = "seconds"

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtService

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

func NewJwtService

func NewJwtService(signMethod, signKey, verifyKey string) *JwtService

func (*JwtService) CreateToken

func (thiz *JwtService) CreateToken(payload map[string]interface{}, duration time.Duration) (string, error)

创建一个JWT并签名

func (*JwtService) MustCreateToken

func (thiz *JwtService) MustCreateToken(payload map[string]interface{}, duration time.Duration) string

func (*JwtService) VerifyAndParseClaims

func (thiz *JwtService) VerifyAndParseClaims(tokenString string) (map[string]interface{}, error)

验证并解析token

Jump to

Keyboard shortcuts

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