throttle

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PresetBandwidth

func PresetBandwidth(name string) int64

PresetBandwidth returns bytes/sec for named presets.

Types

type Reader

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

Reader wraps an io.Reader with bandwidth and latency throttling.

func NewReader

func NewReader(r io.Reader, bps int64, latency time.Duration) *Reader

NewReader wraps r with optional bandwidth (bytes/sec) and latency. Pass 0 for bps or latency to skip that aspect.

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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