wrappers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package wrappers contains httprouter.Handle wrappers that are used in the API.

Index

Constants

This section is empty.

Variables

View Source
var ErrHandlerTimeout = errors.New("http: Handler timeout")

ErrHandlerTimeout is returned on ResponseWriter Write calls in handlers which have timed out.

Functions

func Log

Log wraps a http.HandlerFunc and logs the API call

func TimeOut

TimeOut wraps a http.HandlerFunc and ensure that a response is given under the specified duration.

If the handler takes longer than the time limit, the wrapper responds with a Service Unavailable error, an error message and the handler response which may come later is ignored.

After a timeout, any write the handler to its ResponseWriter will return ErrHandlerTimeout.

If the duration is 0, the wrapper does nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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