access

package
v0.0.0-...-795d1f5 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogRecord

type LogRecord struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

LogRecord is an http.ResponseWriter implementer and wrapper that also records information about the request.

func (*LogRecord) Data

func (r *LogRecord) Data() logrus.Fields

Data returns structure log data about a request.

func (*LogRecord) Write

func (r *LogRecord) Write(p []byte) (int, error)

Write implements the http.Handler#Write method, and records the length of any data written to the response.

func (*LogRecord) WriteHeader

func (r *LogRecord) WriteHeader(status int)

WriteHeader implements the http.Handler#WriteHeader method, and records the response status code.

type Logger

type Logger struct {
	http.Handler
}

Logger wraps an http.Handler and provides request level logging.

func NewLogger

func NewLogger(handler http.Handler) *Logger

NewLogger returns a http.Handler that wraps the supplied handler.

func (Logger) ServeHTTP

func (logger Logger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface and will record information about a request, and log it after the request runs.

Jump to

Keyboard shortcuts

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