downloader

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheDownloadInstruction added in v1.4.0

type CacheDownloadInstruction struct {
	// Method HTTP method
	Method string  `json:"method"`
	Offset *Offset `json:"offset,omitempty"`

	// Url URL
	Url string `json:"url"`
}

type DownloadedFile

type DownloadedFile struct {
	URL      string
	FilePath string
	ETag     string
	Part     int
	Size     int64
}

type Downloader

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

Downloader uses go routines to download parts of a file in parallel with a limit of 20 concurrent uploads. It is provided a list of URLs to upload and a channel to receive the results.

func NewDownloader

func NewDownloader(downloadInstructs []CacheDownloadInstruction, limit int) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(ctx context.Context) ([]DownloadedFile, error)

type Offset added in v1.4.0

type Offset struct {
	// End End position of the part
	End int64 `json:"end"`

	// Part Part number
	Part int32 `json:"part"`

	// Start Start position of the part
	Start int64 `json:"start"`
}

Offset defines model for Offset.

Jump to

Keyboard shortcuts

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