utils

package
v0.0.0-...-9db7971 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJsonAndValid

func BindJsonAndValid(c *gin.Context, model interface{}) interface{}

func GenerateToken

func GenerateToken(id uint64) (signedToken string)

GenerateToken 生成一个token

func ParseToken

func ParseToken(signedToken string) (id uint64, err error)

ParseToken 验证token的正确性,正确则返回id

func ShouldBindAndValid

func ShouldBindAndValid(c *gin.Context, model interface{}) error

func SolveUser

func SolveUser(c *gin.Context) database.User

Types

This section is empty.

Jump to

Keyboard shortcuts

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