middleware

package
v0.0.0-...-c0b3d08 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(handler ReqHandlerFunc, ctx AuthCtx) http.HandlerFunc

Check auth header and serve handler func

func LoggerMW

func LoggerMW(next http.Handler) http.Handler

Log main request info

Types

type AuthCtx

type AuthCtx struct {
	DB      *gorm.DB
	User    token.CustomClaims
	SignKey []byte
}

type ReqHandlerFunc

type ReqHandlerFunc func(ctx AuthCtx, wr http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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