middleware

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BearerAuthenticate

func BearerAuthenticate() server.Middleware

BearerAuthenticate gets the Authorization Header from http request, and checks if given Authorization header is valid.

func Controller

func Controller(c *core.Controller) server.Middleware

Controller sets the controller in the request's middleware context.

func LogRequest

func LogRequest(next http.Handler) http.Handler

LogRequest logs provided request with the response and the status. For full logs requires ResponseWriter middleware.

func ResponseWriter

func ResponseWriter(compressionLevel int) func(next http.Handler) http.Handler

ResponseWriter is a middleware that wraps the response writer into httputil.ResponseWriter. If the client accepts one of the supported compressions, it would also set the compressed writer. In order to set the default compression level set it to -1.

func StoreIDFromParams

func StoreIDFromParams(idKey string) server.Middleware

StoreIDFromParams stores id parameter from the httprouter params under the key: 'idKey'.

func WithCodec

func WithCodec(c codec.Codec) server.Middleware

WithCodec stores the codec in the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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