middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth() gin.HandlerFunc

Check if request is authenticated or not This method first will check if request is from web or the request has Authentication Cookie available then it will validate Authentication cookie token Otherwise it will look for Authorization header and validate that header. Else return invalid json response

func Cors

func Cors(conf *config.Cors) gin.HandlerFunc

func GetAuthTokenFromCookie

func GetAuthTokenFromCookie(encodedToken string) (string, error)

Get auth token string from cookie

func Logger

func Logger(next http.Handler) http.Handler

func RateLimit

func RateLimit(conf *config.RateLimit) mux.MiddlewareFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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