middleware

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(ms []Func, f http.HandlerFunc) http.HandlerFunc

Chain allows to easily chain a sclice of middlewares around a handler

func Logging

func Logging(f http.HandlerFunc) http.HandlerFunc

Logging is a simple request logging middleware

Types

type Func

type Func func(http.HandlerFunc) http.HandlerFunc

Func is a middleware function that allows pre-/post-processing of requests It returns a wrapped handler function allowing to intercept the HTTP call made to the original handler.

func CorsWithOrigin

func CorsWithOrigin(origin string) Func

CorsWithOrigin returns a middleware writing CORS headers for the given origin, all methods and most common headers

Jump to

Keyboard shortcuts

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