middleware

package
v0.0.0-...-a6a5f53 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssureRequestID

func AssureRequestID(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

AssureRequestID create a request id if none ir proveided and insert a logger with it on context

func Cors

func Cors(r *mux.Router) http.Handler

Cors applies cors rules to router

func Handle

func Handle(handler func(r *http.Request) responses.Response) http.HandlerFunc

Handle middleware function to treat rest responses.

func TrimSlashSuffix

func TrimSlashSuffix(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

TrimSlashSuffix Removes the trailing slash from request, except if it is the root url.

Types

type Authorizer

type Authorizer interface {
	AuthorizeRequest(h http.Handler) http.Handler
}

Authorizer authorizes requests

Jump to

Keyboard shortcuts

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