rrwriter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT, BSD-2-Clause Imports: 5 Imported by: 6

README

gone/http/rrwriter

A golang library providing an http.ResponseWriter which records size and status of the written response. For use in auditing a request for accesslogging and/or metrics. The code is adapted from the Gorilla project. Se the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecordingResponseWriter

type RecordingResponseWriter interface {
	http.ResponseWriter
	http.Flusher
	Status() int
	Size() int
	GetTimeStamp() time.Time
	SetTimeStamp(time.Time)
}

RecordingResponseWriter is the interface of the recorder.

func MakeRecorder

MakeRecorder returns a RecordingResponseWriter which wraps around the provided http.ResponseWriter. After the response has been written, you can get Size() and Status()

Jump to

Keyboard shortcuts

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