requestlog

package
v0.0.0-...-0a8dd91 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 15 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxRequestSizeLog = 4 * 1024
View Source
const MaxStringRequestSizeLog = MaxRequestSizeLog / 2

Variables

This section is empty.

Functions

func AccessLogger

func AccessLogger(logOptions bool) func(http.Handler) http.Handler

func CutRequestData

func CutRequestData(data []byte, length int) []byte

Types

type CountingResponseWriter

type CountingResponseWriter struct {
	StatusCode     int
	ResponseLength int
	Hijacked       bool
	ResponseWriter http.ResponseWriter
	ResponseBody   *bytes.Buffer
	RequestBody    *bytes.Buffer
}

func (*CountingResponseWriter) Header

func (crw *CountingResponseWriter) Header() http.Header

func (*CountingResponseWriter) Hijack

func (crw *CountingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*CountingResponseWriter) Write

func (crw *CountingResponseWriter) Write(data []byte) (int, error)

func (*CountingResponseWriter) WriteHeader

func (crw *CountingResponseWriter) WriteHeader(statusCode int)

type Route

type Route struct {
	Path    string
	Method  string
	Handler http.HandlerFunc

	TrackHTTPMetrics func(*Route) func(*CountingResponseWriter)

	LogContent bool
}

func (*Route) ServeHTTP

func (rt *Route) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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