refactor: restore "First stage of access logging middleware."

This reverts commit 82651985c4.
This commit is contained in:
Fernandez Ludovic 2017-05-09 14:02:44 +02:00
parent db09007dbc
commit d2c8824902
9 changed files with 473 additions and 30 deletions

View file

@ -0,0 +1,18 @@
package accesslog
import "io"
type captureRequestReader struct {
source io.ReadCloser
count int64
}
func (r *captureRequestReader) Read(p []byte) (int, error) {
n, err := r.source.Read(p)
r.count += int64(n)
return n, err
}
func (r *captureRequestReader) Close() error {
return r.source.Close()
}