ResponseRecorder
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
HeaderMap
fsthttp.HeaderBody
*bytes.BufferMethods
Append
View sourceAppend records the response body. The data is written to the Body field of the ResponseRecorder.
Parameters
- other: io.ReadCloser
Returns
error
Close
View sourcefunc (r *ResponseRecorder) Close() errorClose is a no-op on ResponseRecorder. It exists to satisfy the fsthttp.ResponseWriter interface.
Returns
error
SetManualFramingMode
View sourcefunc (r *ResponseRecorder) SetManualFramingMode(v bool)SetManualFramingMode is a no-op on ResponseRecorder. It exists to satisfy the fsthttp.ResponseWriter interface.
Parameters
- v: bool
Write
View sourcefunc (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 sourcefunc (r *ResponseRecorder) WriteHeader(code int)WriteHeader records the response code.
Parameters
- code: int