httptest

package module
v0.0.0-...-4b40f4c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package httptest provides a hijackable response recorder similar to the one in net/http/httptest but that also supports hijacking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HijackableResponseRecorder

type HijackableResponseRecorder struct {
	// contains filtered or unexported fields
}

HijackableResponseRecorder is very similar to net/http/httputil.ResponseRecorder but also allows hijacking. The results of data received after hijacking are available in the Body() just as non-hijacked responses.

func NewRecorder

func NewRecorder(hijackedInputData []byte) *HijackableResponseRecorder

Creates a new HijackableResponseRecorder that sends the given hijackedInputData (okay to leave nil).

func (*HijackableResponseRecorder) Body

func (*HijackableResponseRecorder) Closed

func (h *HijackableResponseRecorder) Closed() bool

func (*HijackableResponseRecorder) Code

func (h *HijackableResponseRecorder) Code() int

func (*HijackableResponseRecorder) Flush

func (h *HijackableResponseRecorder) Flush()

func (*HijackableResponseRecorder) Flushed

func (h *HijackableResponseRecorder) Flushed() bool

func (*HijackableResponseRecorder) Header

func (*HijackableResponseRecorder) HeaderMap

func (h *HijackableResponseRecorder) HeaderMap() http.Header

func (*HijackableResponseRecorder) Hijack

func (*HijackableResponseRecorder) Result

func (*HijackableResponseRecorder) Write

func (h *HijackableResponseRecorder) Write(buf []byte) (int, error)

func (*HijackableResponseRecorder) WriteHeader

func (h *HijackableResponseRecorder) WriteHeader(code int)

func (*HijackableResponseRecorder) WriteString

func (h *HijackableResponseRecorder) WriteString(str string) (int, error)

Jump to

Keyboard shortcuts

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