auth

package
v0.0.0-...-c210651 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsToken

func IsToken(tokenString string) bool

func Middleware

func Middleware() gin.HandlerFunc

func NewToken

func NewToken(user *models.User) (string, error)

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	ID       string          `json:"id"`
	Username string          `json:"usr"`
	Kind     models.UserKind `json:"kind"`
}

func CheckToken

func CheckToken(tokenString string) (*Claims, error)

func ClaimsFromContext

func ClaimsFromContext(ctx context.Context) (*Claims, error)

Jump to

Keyboard shortcuts

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