bandwidth

package
v0.0.0-...-c37103c Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: BSD-4-Clause Imports: 3 Imported by: 0

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

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

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