utils

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerFuncErrorHandling

func HandlerFuncErrorHandling(next http.HandlerFunc) http.HandlerFunc

HandlerFuncErrorHandling is a middleware function to defer and return an error response in case of panic during the request

func JWTMiddleware

func JWTMiddleware(next http.Handler, secret string, claims jwt.MapClaims) http.Handler

JWTMiddleware is a middleware function to check the authorization JWT Bearer token header of the request

func ResponseError

func ResponseError(w http.ResponseWriter, r *http.Request, body []byte, status int, message string)

ResponseError makes the error response with payload as json format

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, r *http.Request, body []byte, status int, payload interface{})

ResponseJSON makes the response with payload as json format

Types

This section is empty.

Jump to

Keyboard shortcuts

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