jwt

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptionToken

func DecryptionToken(token string, secret string) (map[string]string, error)

DecryptionToken 解密token

func EncryptionToken

func EncryptionToken(params map[string]string, secret string, timeout time.Duration) (string, error)

EncryptionToken 加密生成token @param params 以map方式存储的key、value数据 @param secret 秘钥 @param timeout token过期时间 @return string 加密成功的token, error 加密失败的错误信息

func Secret

func Secret(secret string) jwt.Keyfunc

Secret 安全认证

Types

type Token

type Token struct {
	Params map[string]string
	jwt.RegisteredClaims
}

Token 生成token的结构体

Jump to

Keyboard shortcuts

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