httputil

package module
v0.0.0-...-189c291 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2016 License: BSD-2-Clause Imports: 4 Imported by: 30

Documentation

Overview

Package httputil is a collection of utilities for net/http handlers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishTrackedConnections

func PublishTrackedConnections(name string)

PublishTrackedConnections sets the name for the published versions of the currently executing requests list

func SlowHandler

func SlowHandler(fn http.HandlerFunc, max time.Duration, cb func(r *http.Request, t time.Duration)) http.HandlerFunc

SlowHandler wraps a http.HandlerFunc and calls cb if the request takes longer than max time to process. The function runs to completion -- slow requests are not aborted.

func TimeHandler

func TimeHandler(fn http.HandlerFunc, cb func(r *http.Request, t time.Duration)) http.HandlerFunc

TimeHandler wraps a http.HandlerFunc and calls cb with the duration.

func TrackConnections

func TrackConnections(fn http.HandlerFunc) http.HandlerFunc

TrackConnections exports via expvar a list of all currently executing requests

Types

This section is empty.

Jump to

Keyboard shortcuts

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