httptest

package
v0.0.0-...-e2f6afb Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package httptest

Package httptest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseHijacker

type ResponseHijacker struct {
	httptest.ResponseRecorder

	HijackError error
	HijackConn  *mockConn
	// contains filtered or unexported fields
}

A test response implementing the http.Hijacker interface.

func NewResponseHijacker

func NewResponseHijacker(hijackedInputData []byte) *ResponseHijacker

func (*ResponseHijacker) Body

func (h *ResponseHijacker) Body() *bytes.Buffer

func (*ResponseHijacker) Code

func (h *ResponseHijacker) Code() int

func (*ResponseHijacker) Flush

func (h *ResponseHijacker) Flush()

func (*ResponseHijacker) Flushed

func (h *ResponseHijacker) Flushed() bool

func (*ResponseHijacker) Header

func (r *ResponseHijacker) Header() http.Header

func (*ResponseHijacker) Hijack

func (r *ResponseHijacker) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*ResponseHijacker) Result

func (h *ResponseHijacker) Result() *http.Response

func (*ResponseHijacker) Write

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

func (*ResponseHijacker) WriteHeader

func (r *ResponseHijacker) WriteHeader(stateCode int)

func (*ResponseHijacker) WriteString

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

Jump to

Keyboard shortcuts

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