middlewares

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication

func Authentication() gin.HandlerFunc

func AuthorizationMustBe

func AuthorizationMustBe(role []string) gin.HandlerFunc

func ExtractToken added in v0.0.4

func ExtractToken(ctx *gin.Context) (tokenString string, err error)

func GenerateToken added in v0.0.4

func GenerateToken(params JWTClaims) (string, error)

func SetAuthBasic

func SetAuthBasic() gin.HandlerFunc

func VerifyToken added in v0.0.4

func VerifyToken(ctx *gin.Context) (interface{}, error)

Types

type JWTClaims added in v0.0.4

type JWTClaims struct {
	ID       uint64 `json:"id"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	Username string `json:"username"`
	Email    string `json:"email"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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