middleware

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(h http.Handler, adapters ...Adapter) http.Handler

Adapt function iterates over all adapters calling them one by one (in reverse order) in a chained manner returning the result of the first adapter.

Types

type Adapter

type Adapter func(http.Handler) http.Handler

Adapter type function is a wrapper that takes in and returns an http.Handler

func CORSHandler

func CORSHandler() Adapter

CORSHandler allows http to be served adding necessary headers to response

func Notify

func Notify() Adapter

Notify function adapts an http.Handler to write out “before” and “after” strings allowing the original http.Handler `h` to do whatever it was already going to do in between. it returns an Adapter, which is just a function that takes and returns an http.Handler.

Jump to

Keyboard shortcuts

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