download

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_RETRY_TIMES     = 8
	RETRY_WAIT_SECS         = 5
	DEFAULT_THREAD          = 64
	DEFAULT_REQUEST_TIMEOUT = time.Second * 7
)

Variables

This section is empty.

Functions

func Download

func Download(configFilePath string, destDir string, thread int, retryNum int, noResume bool) error

Types

type ChunkFetchStat

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

func NewChunkFetchStat

func NewChunkFetchStat() *ChunkFetchStat

func (*ChunkFetchStat) Close

func (cs *ChunkFetchStat) Close()

func (*ChunkFetchStat) IsDone

func (cs *ChunkFetchStat) IsDone(name string) bool

func (*ChunkFetchStat) LoadChunkMeta

func (cs *ChunkFetchStat) LoadChunkMeta(metaPath string) error

func (*ChunkFetchStat) SetDone

func (cs *ChunkFetchStat) SetDone(name string)

type ChunkFetcher

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

func NewChunkFetcher

func NewChunkFetcher(filePath string, chunkInfo *model.ChunkedFileInfo, bar *pb.ProgressBar) *ChunkFetcher

func (*ChunkFetcher) Download

func (c *ChunkFetcher) Download(endPoints []string, retryNum int,
	errFn func(*model.ChunkedFileInfo)) bool

Jump to

Keyboard shortcuts

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