speed

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Once

func Once(speed *Speed, proxy interfaces.Vendor, cfg *interfaces.SlaveRequestConfigsV2)

func RefetchDownloadFiles

func RefetchDownloadFiles(proxy interfaces.Vendor, file string) []string

func SingleThread

func SingleThread(downloadFiles []string, proxy interfaces.Vendor, timeoutSeconds int64, wc *WriteCounter) context.CancelFunc

Types

type Speed

type Speed struct {
	AvgSpeed  uint64
	MaxSpeed  uint64
	TotalSize uint64
	Speeds    []uint64
}

func (*Speed) Run

func (m *Speed) Run(proxy interfaces.Vendor, r *interfaces.SlaveRequest) error

func (*Speed) Type

type WriteCounter

type WriteCounter struct {
	Total     uint64
	RateLimit int64
	Lock      sync.Mutex
}

func (*WriteCounter) Take

func (wc *WriteCounter) Take() uint64

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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