jwt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: Apache-2.0 Imports: 4 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 {
	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
}

type JWT

type JWT struct {
	Secret []byte
	// contains filtered or unexported fields
}
var ServiceJwt *JWT

func (*JWT) Generate

func (js *JWT) Generate() (string, error)

Generate 生成token

func (*JWT) New

func (js *JWT) New(secret string, opts ...newOption) *JWT

New

func (*JWT) ParseClaims

func (js *JWT) ParseClaims(token string) (*Claims, error)

ParseClaims 解析成内置对象

func (*JWT) ParseJson

func (js *JWT) ParseJson(token string) (string, error)

ParseJson 解析成json字符串

Jump to

Keyboard shortcuts

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