util

package
v0.0.0-...-0b50f6a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(username, nickname string) (string, error)

GenerateToken 生成JWT Token

func GetUsernameByToken

func GetUsernameByToken(token string) (username, nickname string, err error)

// GetUsernameByToken 解析Token

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	NickName string `json:"nickname"`
	jwt.StandardClaims
}

func ParseToken

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

ParseToken 解析Token

Jump to

Keyboard shortcuts

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