stats

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncomingTrafficMeter

type IncomingTrafficMeter struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

IncomingTrafficMeter counts the incoming bytes from the underlying request.Body.

func (IncomingTrafficMeter) BytesCount

func (r IncomingTrafficMeter) BytesCount() int

BytesCount returns the number of transferred bytes

func (*IncomingTrafficMeter) Read

func (r *IncomingTrafficMeter) Read(p []byte) (n int, err error)

Read calls the underlying Read and counts the transferred bytes.

type OutgoingTrafficMeter

type OutgoingTrafficMeter struct {
	// wrapper for underlying http.ResponseWriter.
	http.ResponseWriter
	// contains filtered or unexported fields
}

OutgoingTrafficMeter counts the outgoing bytes through the responseWriter.

func (OutgoingTrafficMeter) BytesCount

func (w OutgoingTrafficMeter) BytesCount() int

BytesCount returns the number of transferred bytes

func (*OutgoingTrafficMeter) Flush

func (w *OutgoingTrafficMeter) Flush()

Flush calls the underlying Flush.

func (*OutgoingTrafficMeter) Write

func (w *OutgoingTrafficMeter) Write(p []byte) (n int, err error)

Write calls the underlying write and counts the output bytes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL