Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileRequest ¶
IsFileRequest returns true if the request is for a file instead of a page, i.e /about.
Types ¶
type ResponseRecorder ¶
type ResponseRecorder struct { http.ResponseWriter Status int Body *bytes.Buffer }
ResponseRecorder is a custom response writer that captures the response body and Status code.
func NewResponseRecorder ¶
func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder
NewResponseRecorder creates a new ResponseRecorder with the given ResponseWriter. It creates a new buffer for the response body.
func (*ResponseRecorder) Write ¶
func (r *ResponseRecorder) Write(b []byte) (int, error)
Write writes the response body to the captured buffer and the underlying ResponseWriter.
func (*ResponseRecorder) WriteHeader ¶
func (r *ResponseRecorder) WriteHeader(statusCode int)
WriteHeader captures the Status code and writes it to the underlying ResponseWriter.
Click to show internal directories.
Click to hide internal directories.