Documentation ¶
Index ¶
- type ReaderCounter
- type ResponseWriterCounter
- func (counter *ResponseWriterCounter) Count() uint64
- func (counter *ResponseWriterCounter) Header() http.Header
- func (counter *ResponseWriterCounter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (counter *ResponseWriterCounter) Started() time.Time
- func (counter *ResponseWriterCounter) StatusCode() int
- func (counter *ResponseWriterCounter) Write(buf []byte) (int, error)
- func (counter *ResponseWriterCounter) WriteHeader(statusCode int)
- type WriterCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReaderCounter ¶
ReaderCounter is counter for io.Reader
func NewReaderCounter ¶
func NewReaderCounter(r io.Reader) *ReaderCounter
NewReaderCounter function for create new ReaderCounter
func (*ReaderCounter) Count ¶
func (counter *ReaderCounter) Count() uint64
Count function return counted bytes
type ResponseWriterCounter ¶
type ResponseWriterCounter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriterCounter is counter for http.ResponseWriter
func NewResponseWriterCounter ¶
func NewResponseWriterCounter(rw http.ResponseWriter) *ResponseWriterCounter
NewResponseWriterCounter function create new ResponseWriterCounter
func (*ResponseWriterCounter) Count ¶
func (counter *ResponseWriterCounter) Count() uint64
Count function return counted bytes
func (*ResponseWriterCounter) Header ¶
func (counter *ResponseWriterCounter) Header() http.Header
Header returns underlying Header result
func (*ResponseWriterCounter) Hijack ¶
func (counter *ResponseWriterCounter) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack returns underlying Hijack
func (*ResponseWriterCounter) Started ¶
func (counter *ResponseWriterCounter) Started() time.Time
Started returns started value
func (*ResponseWriterCounter) StatusCode ¶ added in v1.0.4
func (counter *ResponseWriterCounter) StatusCode() int
StatusCode returns sent status code
func (*ResponseWriterCounter) Write ¶
func (counter *ResponseWriterCounter) Write(buf []byte) (int, error)
Write returns underlying Write result, while counting data size
func (*ResponseWriterCounter) WriteHeader ¶
func (counter *ResponseWriterCounter) WriteHeader(statusCode int)
WriteHeader returns underlying WriteHeader, while setting Runtime header
type WriterCounter ¶
WriterCounter is counter for io.Writer
func NewWriterCounter ¶
func NewWriterCounter(w io.Writer) *WriterCounter
NewWriterCounter function create new WriterCounter
func (*WriterCounter) Count ¶
func (counter *WriterCounter) Count() uint64
Count function return counted bytes