brokenrecorder

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

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

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(data []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