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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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