middleware

package
v0.0.0-...-454bc57 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2015 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetJSONHeader

func SetJSONHeader(next http.Handler) http.Handler

SetJSONHeader middleware sets response Content-Type to application/json.

Types

type HTTPHandlerMock

type HTTPHandlerMock struct {
	// contains filtered or unexported fields
}

HTTPHandlerMock structure is usead for injecting dependency of type http.Handler.

func (*HTTPHandlerMock) ServeHTTP

func (h *HTTPHandlerMock) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware type is an adapter to allow the use of ordinary functions as handlers.

func BodyParser

func BodyParser(v interface{}) Middleware

BodyParser middleware parses body of request to given structure and sets its to context.

Jump to

Keyboard shortcuts

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