harwp

package module
v0.0.0-...-c47a861 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

Harwp

Harwp provides a proxy type for http.ResponseWriter of the Go standard library.

The intended use of the proxy type is for middlewares to inspect the http.ResponseWriter after the encapsulated http.Handler has finished their execution.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseWriterProxier

type ResponseWriterProxier interface {
	http.ResponseWriter

	// StatusCode returns the HTTP status of the request, or 0 if
	// one has not yet been sent or if the connection was hijacked.
	StatusCode() int

	// HeadersWritten indicates whenever the response headers
	// were already written or not.
	HeadersWritten() bool

	// BytesWritten returns the total number of bytes sent to the
	// client so far.
	BytesWritten() int

	// Hijacked indicates whenever the connection was hijacked or not.
	Hijacked() bool

	// Unwrap returns the original proxied http.ResponseWriter.
	Unwrap() http.ResponseWriter
}

ResponseWriterProxier wraps a http.ResponseWriter and allows it to be inspected by middlewares.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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