ResponseRecorder

Structin fsttestcompute-sdk-go v1.11.0View source
type ResponseRecorder struct {
Code int
HeaderMap fsthttp.Header
// contains filtered or unexported fields
}

ResponseRecorder is an implementation of fsthttp.ResponseWriter that records its mutations for later inspection in tests.

Fields

Code

int

Methods

func (r *ResponseRecorder) Append(other io.ReadCloser) error

Append records the response body. The data is written to the Body field of the ResponseRecorder.

Parameters

other: io.ReadCloser

Returns

error
func (r *ResponseRecorder) Close() error

Close is a no-op on ResponseRecorder. It exists to satisfy the fsthttp.ResponseWriter interface.

Returns

error
func (r *ResponseRecorder) Header() fsthttp.Header

Header returns the response headers to mutate within a handler.

Returns

SetManualFramingMode

View source
func (r *ResponseRecorder) SetManualFramingMode(v bool)

SetManualFramingMode is a no-op on ResponseRecorder. It exists to satisfy the fsthttp.ResponseWriter interface.

Parameters

v: bool
func (r *ResponseRecorder) Write(b []byte) (int, error)

Write records the response body. The data is written to the Body field of the ResponseRecorder.

Parameters

b: []byte

Returns

(int, error)

WriteHeader

View source
func (r *ResponseRecorder) WriteHeader(code int)

WriteHeader records the response code.

Parameters

code: int