httputil

package
v0.0.0-...-d4b3ac2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package httputil provides http utilities for stenographer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(w http.ResponseWriter, r *http.Request, timeout time.Duration) base.Context

Context returns a new context.Content that cancels when the underlying http.ResponseWriter closes.

func Log

func Log(w http.ResponseWriter, r *http.Request, logRequestBody bool) http.ResponseWriter

New returns a new ResponseWriter which provides a nice String() method for easy printing. The expected usage is:

func (h *myHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  w = httputil.Log(w, r, false)
  defer log.Print(w)  // Prints out useful information about request AND response
  ... do stuff ...
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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