token

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserID   int64
	UserName string
	jwt.StandardClaims
}

type Token

type Token interface {

	// JwtSign 签名
	JwtSign(userID int64, userName string, expireDuration time.Duration) (tokenString string, err error)

	// JwtParse 解密
	JwtParse(tokenString string) (*Claims, error)

	// UrlSign URL 签名方式,不支持解密
	UrlSign(path string, method string, params url.Values) (tokenString string, err error)
}

func New

func New(secret string) Token

Jump to

Keyboard shortcuts

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