auth

package
v0.0.0-...-0864a4c Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAuthToken

func GenAuthToken(uid uint64, expireDuration time.Duration, jwtSecret string) (string, error)

func GetCurrentUid

func GetCurrentUid(ctx *gin.Context) (uint64, error)

func JWT

func JWT() gin.HandlerFunc

func ParseAuthToken

func ParseAuthToken(token string, secret string) (uint64, error)

func SetCurrentUid

func SetCurrentUid(ctx *gin.Context, uid uint64)

Types

type Claims

type Claims struct {
	Uid uint64
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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