ioshaper

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewThrottledReader

func NewThrottledReader(source io.ReadCloser, bitrate int64) io.ReadCloser

Types

type Bitrate

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

func NewBitrate

func NewBitrate[T bitrateCastFromType](bitrate T) Bitrate

func (Bitrate) ByteRate

func (b Bitrate) ByteRate() int64

func (Bitrate) DurationToBits

func (b Bitrate) DurationToBits(duration time.Duration) int64

func (Bitrate) DurationToBytes

func (b Bitrate) DurationToBytes(duration time.Duration) int64

func (Bitrate) IsZero

func (b Bitrate) IsZero() bool

func (Bitrate) TransferBits

func (b Bitrate) TransferBits(size int) time.Duration

func (Bitrate) TransferBytes

func (b Bitrate) TransferBytes(size int) time.Duration

Jump to

Keyboard shortcuts

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