downloader

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package downloader contains 2 types of downloader: P2PDownloader, DirectDownloader. P2PDownloader uses P2P pattern to download files from peers. DirectDownloader downloads files from file source directly. It's used when P2PDownloader download files failed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoDownloadTimeout

func DoDownloadTimeout(downloader Downloader, timeout time.Duration) error

DoDownloadTimeout downloads the file and waits for response during the given timeout duration.

func MoveFile

func MoveFile(src string, dst string, expectMd5 string) error

MoveFile moves a file from src to dst and checks if the MD5 code is expected before that.

Types

type Downloader

type Downloader interface {
	Run() error
	Cleanup()
}

Downloader is the interface to download files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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