Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WrappedResponseWriter ¶
type WrappedResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
WrappedResponseWriter wraps a standard http.ResponseWriter so we can store the status code, track size and duration of response.
func NewWrappedResponseWriter ¶
func NewWrappedResponseWriter(res http.ResponseWriter) *WrappedResponseWriter
NewWrappedResponseWriter creates a new wrapped response writer
func (*WrappedResponseWriter) Body ¶
func (w *WrappedResponseWriter) Body() []byte
Body flattens the chunks of byte arrays into a single byte array
func (*WrappedResponseWriter) DurationMS ¶
func (w *WrappedResponseWriter) DurationMS() int
DurationMS returns the duration of this response in milliseconds
func (*WrappedResponseWriter) Header ¶
func (w *WrappedResponseWriter) Header() http.Header
Header passes through to the response writer
func (*WrappedResponseWriter) ShouldReportOnAirbrake ¶
func (w *WrappedResponseWriter) ShouldReportOnAirbrake() bool
ShouldReportOnAirbrake returns true if response code is 5xx
func (*WrappedResponseWriter) Size ¶
func (w *WrappedResponseWriter) Size() int
Size returns the total bytes written
func (*WrappedResponseWriter) Status ¶
func (w *WrappedResponseWriter) Status() int
Status returns the captured status code
Click to show internal directories.
Click to hide internal directories.