middleware

package
v0.0.0-...-3f885a5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJwtToken

func CreateJwtToken(c *gin.Context, ID bson.ObjectId, UserName string)

创建jwttoken

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

func ParseJwtToken

func ParseJwtToken(tokenString string) (bson.ObjectId, string, bool)

解析jwt

func RefreshToken

func RefreshToken(c *gin.Context)

刷新token

func SetCookie

func SetCookie(c *gin.Context, name string, value string)

设置cookie

func SigninRequired

func SigninRequired(c *gin.Context)

需要登录

Types

type CustomClaims

type CustomClaims struct {
	UserName string        `json:"username"`
	ID       bson.ObjectId `json:"id" bson:"_id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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