jwt

package
v0.0.0-...-e486b77 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(claims interface{}) (string, error)

自定义对象生成token

func GenerateTokenByBuiltin

func GenerateTokenByBuiltin(claims Claims) (string, error)

以内置对象生成token

func Parse

func Parse(token string) (string, error)

解析成json字符串

func Setup

func Setup(_jwtSecret string)

Types

type Claims

type Claims struct {
	Unique_name  string `json:"unique_name"`
	Guid         string `json:"guid"`
	Avatar       string `json:"avatar"`
	DisplayName  string `json:"displayName"`
	LoginName    string `json:"loginName"`
	EmailAddress string `json:"emailAddress"`
	UserType     string `json:"userType"`
	Time         string `json:"time"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

解析成内置对象

Jump to

Keyboard shortcuts

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