jwt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientSecretVerifier

func ClientSecretVerifier(
	cSecret string,
	sInfo LoginInfo,
) (errMsg string, err error)

客户端密钥验证

func GetToken

func GetToken(claims *Claims, expireTime int64) (string, error)

token字符串获取

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	ServerID string `json:"server_id"`
}

func ParserToken

func ParserToken(strToken string) (*Claims, error)

token解析

type LoginInfo

type LoginInfo struct {
	ServerID     string
	ClientSecret string
	Timestamp    int64
}

func EncryptSecret

func EncryptSecret(info LoginInfo) LoginInfo

加密密钥

Jump to

Keyboard shortcuts

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