download

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountIEC

func ByteCountIEC(b int64) string

func ByteCountIECTrim

func ByteCountIECTrim(b int64) string

func Download

func Download(link string, timeout time.Duration, handshakeTimeout time.Duration, resultChan chan<- int64, startChan chan<- time.Time) (int64, error)

func DownloadComplete

func DownloadComplete(link string, timeout time.Duration, handshakeTimeout time.Duration) (int64, error)

func DownloadRange

func DownloadRange(ctx context.Context, link string, part int, timeout time.Duration, handshakeTimeout time.Duration, resultChan chan<- int64, startChan chan<- time.Time) (int64, error)

func WSDownload

func WSDownload(link string, timeout time.Duration, handshakeTimeout time.Duration, resultChan chan<- int64) (int64, error)

Types

type Discard

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

func (*Discard) Size

func (e *Discard) Size() int64

func (*Discard) Write

func (e *Discard) Write(p []byte) (n int, err error)

type DownloadOption

type DownloadOption struct {
	URL              string
	DownloadTimeout  time.Duration
	HandshakeTimeout time.Duration
	Ranges           []Range
}

type Range

type Range struct {
	Url       string
	RangeFrom int64
	RangeTo   int64
}

Jump to

Keyboard shortcuts

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