loggers

package
v0.0.0-...-68b51cc Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2013 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package loggers provides routines for creating weblogs.Logger implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApacheUser

func ApacheUser(user *url.Userinfo) string

ApacheUser formats user info in a request in apache style. That is missing or empty user name is formatted as '-'

func StripPort

func StripPort(remoteAddr string) string

StripPort strips the port number off of a remote address

Types

type Capture

type Capture struct {
	// The underlying ResponseWriter
	http.ResponseWriter
	http.Hijacker
	// contains filtered or unexported fields
}

Capture provides a basic capture of a response

func (*Capture) HasStatus

func (c *Capture) HasStatus() bool

HasStatus returns true if response has a status.

func (*Capture) Size

func (c *Capture) Size() int

The size of the resposne

func (*Capture) Status

func (c *Capture) Status() int

The HTTP status code of the response

func (*Capture) Write

func (c *Capture) Write(b []byte) (int, error)

func (*Capture) WriteHeader

func (c *Capture) WriteHeader(status int)

type Snapshot

type Snapshot struct {
	// Copied from Request.RemoteAddr
	RemoteAddr string
	// Copied from Request.Method
	Method string
	// Copied from Request.Proto
	Proto string
	// Copied from Request.URL
	URL *url.URL
	// The http referer
	Referer string
	// The user agent
	UserAgent string
}

Snapshot provides a basic snapshot of a request.

func NewSnapshot

func NewSnapshot(r *http.Request) *Snapshot

Jump to

Keyboard shortcuts

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