jwt

package
v1.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrorServerBusy = "server is busy"
	ErrorReLogin    = "relogin"
)

Variables

View Source
var (
	Secret     = "123#111" //salt
	ExpireTime = 3600      //token expire time
)

Functions

func Login

func Login(c *gin.Context)

登录,获取jwt token

func Refresh

func Refresh(c *gin.Context)

func SayHello

func SayHello(c *gin.Context)

func Verify

func Verify(c *gin.Context)

func VerifyMiddleware

func VerifyMiddleware(token string) (bool, error)

Types

type JWTClaims

type JWTClaims struct {
	jwt.StandardClaims
	UserID   int    `json:"user_id"`
	Password string `json:"password"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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