middleware

package
v6.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MiddlewareChain

func MiddlewareChain(h http.Handler, mw []Middleware) http.Handler

func NormalizeQueryValues

func NormalizeQueryValues(queryParams url.Values)

NormalizeQueryValues replaces comma-separated values with individual values

func NormalizeQueryValuesHandler

func NormalizeQueryValuesHandler(next http.Handler) http.Handler

NormalizeQueryValuesHandler normalizes an input query of "key=value1,value2,value3" to "key=value1&key=value2&key=value3"

Types

type Middleware

type Middleware func(http.Handler) http.Handler

func AcceptEncodingHeaderHandler added in v6.1.1

func AcceptEncodingHeaderHandler() Middleware

AcceptEncodingHeaderHandler compresses the response before sending it back to the client, if gzip is supported.

func AcceptHeaderHandler

func AcceptHeaderHandler(serverAcceptedTypes []string) Middleware

AcceptHeaderHandler checks if the client's response preference is handled

func ContentTypeHandler

func ContentTypeHandler(acceptedMediaTypes []string) Middleware

ContentTypeHandler checks request for the appropriate media types otherwise returning a http.StatusUnsupportedMediaType error

func CorsHandler

func CorsHandler(allowOrigins []string) Middleware

CorsHandler sets the cors settings on api endpoints

Jump to

Keyboard shortcuts

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