xjwt

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExpireDuration = time.Hour * 24 * 30

Variables

View Source
var (
	ErrTokenInvalid = errors.New("Couldn't handle this token")
)

Functions

func CreateToken

func CreateToken(bus string, expires time.Duration) (string, error)

CreateToken 创建Token

func Init

func Init(key string)

func ParseToken

func ParseToken(tokenString string, v interface{}) error

ParseToken 解析Token

Types

type Business

type Business struct {
	UUID string `json:"uuid"`
	Role uint64 `json:"role"`
}

type CustomClaims

type CustomClaims struct {
	Business string
	jwtgo.StandardClaims
}

type TokenResp

type TokenResp struct {
	Token     string `json:"token"`
	ExpiredAt uint64 `json:"expired_at"`
}

Jump to

Keyboard shortcuts

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