middleware

package
v0.0.0-...-990f775 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHeaders

func AddHeaders(headers []string)

func Auth

func Auth(next http.Handler) http.Handler

Checking for token authentication

func ConcurrentLimiter

func ConcurrentLimiter(maxConcurrentRequests int, next http.Handler) http.Handler

func Cors

func Cors(next http.Handler) http.Handler

func Json

func Json(next http.Handler) http.Handler

func Method

func Method(next http.Handler, methods ...string) http.Handler

func Panic

func Panic(next http.Handler) http.Handler

func Timeout

func Timeout(timeout time.Duration, next http.Handler) http.Handler

func Translator

func Translator(next http.Handler) http.Handler

Types

type PanicResponse

type PanicResponse struct {
	Message string `json:"message"`
	Action  int    `json:"action"`
	Code    int    `json:"code"`
	Errors  any    `json:"errors"`
}

Jump to

Keyboard shortcuts

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