capture

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 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 CaptureResponseWriter

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

CaptureResponseWriter captures the response body to a byte slice

func NewCaptureResponseWriter

func NewCaptureResponseWriter() *CaptureResponseWriter

NewCaptureResponseWriter returns a new CaptureResponseWriter

func (*CaptureResponseWriter) Body

func (sw *CaptureResponseWriter) Body() []byte

Body returns the captured response body

func (*CaptureResponseWriter) Header

func (sw *CaptureResponseWriter) Header() http.Header

Header returns the response header map

func (*CaptureResponseWriter) StatusCode

func (sw *CaptureResponseWriter) StatusCode() int

StatusCode returns the captured status code

func (*CaptureResponseWriter) Write

func (sw *CaptureResponseWriter) Write(b []byte) (int, error)

Write appends data to the response body

func (*CaptureResponseWriter) WriteHeader

func (sw *CaptureResponseWriter) WriteHeader(code int)

WriteHeader sets the status code

Jump to

Keyboard shortcuts

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