multiclient

package
v0.0.0-...-c966e82 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Name     string
	Size     int64
	Poz      int64
	Duration time.Duration
}

type Download

type Download struct {
	ContentLength int64

	Timeout   time.Duration
	OnHead    func(Head)
	OnHeadEnd func()
	OnChunk   func(Chunk)
	OnStopped func(string)
	// contains filtered or unexported fields
}

func NewDownload

func NewDownload(client *http.Client, bitesize int64, writer io.WriteSeeker, wal *os.File, reqs ...*http.Request) *Download

func (*Download) Done

func (d *Download) Done() []bool

func (*Download) Fetch

func (d *Download) Fetch() error

func (*Download) Speed

func (d *Download) Speed() float64

Speed return last bite speed in bytes per second

func (*Download) Written

func (d *Download) Written() int64
type Head struct {
	Domain  string
	Latency time.Duration
	Size    int64
}

type Multiclient

type Multiclient struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

func New

func New(biteSize int64) *Multiclient

func (*Multiclient) Download

func (mc *Multiclient) Download(writer io.WriteSeeker, wal *os.File, reqs ...*http.Request) *Download

Jump to

Keyboard shortcuts

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