stats

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: AGPL-3.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) BytesRead

func (r *IncomingTrafficMeter) BytesRead() int64

BytesRead 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) BytesWritten

func (w *OutgoingTrafficMeter) BytesWritten() int64

BytesWritten 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