middleware

package
v0.1.20200821 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS = iota
	InvalidParams
	ErrorAuthCheckTokenFail
	ErrorAuthCheckTokenTimeout
)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(userName, password string, role int) (string, error)

func JWT

func JWT() gin.HandlerFunc

Types

type Claims

type Claims struct {
	UserName string `json:"user_name"`
	Password string `json:"password"`
	Role     int    `json:"role"`
	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