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) (context.Context, context.CancelFunc)
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.
Click to show internal directories.
Click to hide internal directories.