Skip to content

Commit

Permalink
ResponseWriterCounter: return statusCode
Browse files Browse the repository at this point in the history
  • Loading branch information
miolini authored Feb 6, 2020
1 parent 1628b0e commit 09802d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
// ResponseWriterCounter is counter for http.ResponseWriter
type ResponseWriterCounter struct {
http.ResponseWriter
count uint64
started time.Time
count uint64
started time.Time
statusCode int
}

// NewResponseWriterCounter function create new ResponseWriterCounter
Expand Down Expand Up @@ -56,3 +57,8 @@ func (counter *ResponseWriterCounter) Count() uint64 {
func (counter *ResponseWriterCounter) Started() time.Time {
return counter.started
}

// StatusCode returns sent status code
func (counter *ResponseWriterCounter) StatusCode() int {
return counter.statusCode
}

0 comments on commit 09802d7

Please sign in to comment.