middleware

package
v0.0.0-...-56ff5f7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminVerify

func AdminVerify(next http.Handler) http.Handler

func CheckToken

func CheckToken(token string) (*jwtclaim, error)

func GeneralVerify

func GeneralVerify(next http.Handler) http.Handler

func GenerateToken

func GenerateToken(id uint, roleid uint, email string) (string, error)

func GetUserID

func GetUserID(r *http.Request) (uint, error)

Types

type IValidation

type IValidation interface {
	Validate(data interface{}) error
	Error(err error) error
}

func NewValidation

func NewValidation() IValidation

type Validation

type Validation struct {
	// contains filtered or unexported fields
}

func (*Validation) Error

func (v *Validation) Error(err error) error

func (*Validation) Validate

func (v *Validation) Validate(data interface{}) error

Jump to

Keyboard shortcuts

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