jwt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

* * @Author: TheLife * @Date: 2020-2-25 9:00 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(tokenString string, appName string, appSecret string) (interface{}, error)

JwtParseUser parsing token

Types

type Claims

type Claims struct {
	User interface{}
	jwt.StandardClaims
}

type JwtObj

type JwtObj struct {
	Key      string  `json:"key"`
	Token    string  `json:"token"`
	ExpireTs int64   `json:"expire"`
	Alive    float64 `json:"alive"`
}

func GenerateToken

func GenerateToken(m interface{}, appName string, appSecret string, key string, expireHour int) (*JwtObj, error)

GenerateToken generate tokens used for auth

Jump to

Keyboard shortcuts

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