Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseRecorder ¶
type ResponseRecorder struct {
http.ResponseWriter
// contains filtered or unexported fields
}
ResponseRecorder records response metadata for later inspection.
func NewResponseRecorder ¶
func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder
NewResponseRecorder wraps a response writer with status/body capture.
func (*ResponseRecorder) BodyBytes ¶
func (w *ResponseRecorder) BodyBytes() []byte
BodyBytes returns the buffered prefix of the response body.
func (*ResponseRecorder) StatusCode ¶
func (w *ResponseRecorder) StatusCode() int
StatusCode returns the written status code, defaulting to 200 when none was set explicitly.
func (*ResponseRecorder) WriteHeader ¶
func (w *ResponseRecorder) WriteHeader(status int)
Click to show internal directories.
Click to hide internal directories.