middlewares

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAdmin

func IsAdmin(next echo.HandlerFunc) echo.HandlerFunc

func IsUserId

func IsUserId(next echo.HandlerFunc) echo.HandlerFunc

Types

type ConfigJWT

type ConfigJWT struct {
	SecretJWT       string
	ExpiresDuration int
}

func (*ConfigJWT) GenerateTokenJWT

func (jwtConf *ConfigJWT) GenerateTokenJWT(id int, isAdmin int) (string, error)

func (*ConfigJWT) Init

func (jwtConf *ConfigJWT) Init() middleware.JWTConfig

type JWTCustomClaims

type JWTCustomClaims struct {
	Id      int `json:"id"`
	IsAdmin int `json:"is_admin"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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