Help us shape the future of Go! Take the 2026 Go Developer Survey

httpcapture

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseRecorder

type ResponseRecorder struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

ResponseRecorder records response metadata for later inspection.

func NewResponseRecorder

func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder

NewResponseRecorder wraps a response writer with status/body capture.

func (*ResponseRecorder) BodyBytes

func (w *ResponseRecorder) BodyBytes() []byte

BodyBytes returns the buffered prefix of the response body.

func (*ResponseRecorder) Failed added in v0.6.0

func (w *ResponseRecorder) Failed() bool

func (*ResponseRecorder) MarkFailed added in v0.6.0

func (w *ResponseRecorder) MarkFailed()

MarkFailed records a post-commit transport failure that can no longer be represented by the HTTP status (for example an aborted SSE stream).

func (*ResponseRecorder) StatusCode

func (w *ResponseRecorder) StatusCode() int

StatusCode returns the written status code, defaulting to 200 when none was set explicitly.

func (*ResponseRecorder) Unwrap added in v0.4.0

func (w *ResponseRecorder) Unwrap() http.ResponseWriter

func (*ResponseRecorder) Write

func (w *ResponseRecorder) Write(p []byte) (int, error)

func (*ResponseRecorder) WriteHeader

func (w *ResponseRecorder) WriteHeader(status int)

Jump to

Keyboard shortcuts

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