report

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2014 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package report organizes textual reporting from the HTTP context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(writer io.Writer, next http.Handler) http.Handler

JSON writes a JSON encoded Event to the provided writer at the completion of each request

Types

type Event

type Event struct {
	Time           time.Time `json:"time,omitempty"`
	Method         string    `json:"method,omitempty"`
	Url            string    `json:"url,omitempty"`
	Path           string    `json:"path,omitempty"`
	Proto          string    `json:"proto,omitempty"`
	Status         int       `json:"status,omitempty"`
	Ms             int       `json:"ms"`
	Size           int64     `json:"size"`
	RemoteAddr     string    `json:"remote_addr,omitempty"`
	ForwardedFor   string    `json:"forwarded_for,omitempty"`
	ForwardedProto string    `json:"forwarded_proto,omitempty"`
	Range          string    `json:"range,omitempty"`
	Host           string    `json:"host,omitempty"`
	Referrer       string    `json:"referrer,omitempty"`
	UserAgent      string    `json:"user_agent,omitempty"`
	Authorization  string    `json:"authorization,omitempty"`
	Region         string    `json:"region,omitempty"`
	Country        string    `json:"country,omitempty"`
	City           string    `json:"city,omitempty"`
	RequestId      string    `json:"request_id,omitempty"`
}

Event contains significant fields from the request or response to report

Jump to

Keyboard shortcuts

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