bandwidth

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: BSD-3-Clause Imports: 3 Imported by: 7 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTConn

type BTConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*BTConn) Read

func (bt *BTConn) Read(p []byte) (n int, err error)

func (*BTConn) Write

func (bt *BTConn) Write(p []byte) (n int, err error)

type BandwidthTracker

type BandwidthTracker interface {
	Reset()
	GetTotalBandwidth() int64
	GetWriteBytes() int64
	GetReadBytes() int64
	TrackConnection(ctx context.Context, conn net.Conn) net.Conn
}

type NopeTracker

type NopeTracker struct {
}

func NewNopeTracker

func NewNopeTracker() *NopeTracker

func (*NopeTracker) GetReadBytes

func (bt *NopeTracker) GetReadBytes() int64

func (*NopeTracker) GetTotalBandwidth

func (bt *NopeTracker) GetTotalBandwidth() int64

func (*NopeTracker) GetWriteBytes

func (bt *NopeTracker) GetWriteBytes() int64

func (*NopeTracker) Reset added in v1.7.10

func (bt *NopeTracker) Reset()

func (*NopeTracker) TrackConnection

func (bt *NopeTracker) TrackConnection(ctx context.Context, conn net.Conn) net.Conn

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker() *Tracker

func (*Tracker) GetReadBytes

func (bt *Tracker) GetReadBytes() int64

func (*Tracker) GetTotalBandwidth

func (bt *Tracker) GetTotalBandwidth() int64

func (*Tracker) GetWriteBytes

func (bt *Tracker) GetWriteBytes() int64

func (*Tracker) Reset added in v1.7.10

func (bt *Tracker) Reset()

func (*Tracker) TrackConnection

func (bt *Tracker) TrackConnection(ctx context.Context, conn net.Conn) net.Conn

Jump to

Keyboard shortcuts

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