brokenrecorder

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokeRecorder

type BrokeRecorder struct {
	Code      int
	HeaderMap http.Header
	Body      *bytes.Buffer
	// contains filtered or unexported fields
}

BrokeRecorder is a place holder for test usage

func NewRecorder

func NewRecorder() *BrokeRecorder

NewRecorder returns an initialized ResponseRecorder.

func (*BrokeRecorder) Header

func (rw *BrokeRecorder) Header() http.Header

Header implements http.ResponseWriter. It returns the response headers to mutate within a handler. To test the headers that were written after a handler completes, use the Result method and see the returned Response value's Header.

func (*BrokeRecorder) Write

func (rw *BrokeRecorder) Write(_ []byte) (n int, err error)

Write implements http.ResponseWriter. The data in buf is written to rw.Body, if not nil.

func (*BrokeRecorder) WriteHeader

func (rw *BrokeRecorder) WriteHeader(code int)

WriteHeader implements http.ResponseWriter.

Jump to

Keyboard shortcuts

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