traefik/middlewares/accesslog/capture_request_reader.go
2017-05-11 16:27:13 +02:00

18 lines
308 B
Go

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()
}