Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomResponseWriter ¶
type CustomResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
CustomResponseWriter implements http.ResponseWriter and extends the default implementation by allowing us access to the http response code
func NewCustomResponseWriter ¶
func NewCustomResponseWriter(resp http.ResponseWriter, catchBody bool) *CustomResponseWriter
NewCustomResponseWriter returns a CustomResponseWriter from the supplied http.ResponseWriter
func (*CustomResponseWriter) Body ¶
func (resp *CustomResponseWriter) Body() []byte
Body returns the HTTP body (if `catchBody == true` in the constructor)
func (*CustomResponseWriter) Status ¶
func (resp *CustomResponseWriter) Status() int
Status returns the HTTP status code (or 0 if not set)
func (*CustomResponseWriter) Write ¶
func (resp *CustomResponseWriter) Write(in []byte) (int, error)
Write implements http.ResponseWriter
func (*CustomResponseWriter) WriteHeader ¶
func (resp *CustomResponseWriter) WriteHeader(code int)
WriteHeader implements http.ResponseWriter
Click to show internal directories.
Click to hide internal directories.