requestlog

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler wraps an HTTP handler so that a log entry can be generated for request/response stats

func NewHandler

func NewHandler(h http.HandlerFunc, l *lr.Logger) *Handler

NewHandler creates a new Handler instance based on an http.HandlerFunc

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP calls its underlying handler's ServeHTTP method, then calls Log after the handler returns.

ServeHTTP will always consume the request body up to the first error, even if the underlying handler does not.

Jump to

Keyboard shortcuts

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