httpclient

package
v0.0.0-...-f764b3d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FlushDiskSize = 1024 * 1024

Variables

This section is empty.

Functions

func CheckMultipart

func CheckMultipart(urls string) (bool, error)

func GetSize

func GetSize(urls string) (int64, error)

Types

type DownloadProgress

type DownloadProgress struct {
	From          int64 `json:"From"`
	To            int64 `json:"To"`
	Pos           int64 `json:"Pos"`
	BytesInSecond int64
	Speed         int64
	Lsmt          time.Time
}

type Downloader

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

func CreateDownloader

func CreateDownloader(url string, fp string, seg int64) (dl *Downloader, err error)

func RestoreDownloader

func RestoreDownloader(url string, fp string, dp []DownloadProgress) (dl *Downloader, err error)

func (*Downloader) GetProgress

func (dl *Downloader) GetProgress() []DownloadProgress

func (*Downloader) StartAll

func (dl *Downloader) StartAll() []error

func (*Downloader) StopAll

func (dl *Downloader) StopAll() []error

type FileInfo

type FileInfo struct {
	Size     int64  `json:"Size"`
	FileName string `json:"FileName"`
	Url      string `json:"Url"`
}

type PartialDownloader

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

func CreatePartialDownloader

func CreatePartialDownloader(url string, file *iotools.SafeFile, from int64, pos int64, to int64) *PartialDownloader

func (*PartialDownloader) AfterStop

func (pd *PartialDownloader) AfterStop() error

func (*PartialDownloader) AfterStopDownload

func (pd *PartialDownloader) AfterStopDownload() error

func (*PartialDownloader) BeforeDownload

func (pd *PartialDownloader) BeforeDownload() error

func (*PartialDownloader) BeforeRun

func (pd *PartialDownloader) BeforeRun() error

func (*PartialDownloader) DoWork

func (pd *PartialDownloader) DoWork() (bool, error)

func (*PartialDownloader) DownloadSergment

func (pd *PartialDownloader) DownloadSergment() (bool, error)

func (PartialDownloader) GetProgress

func (pd PartialDownloader) GetProgress() interface{}

Jump to

Keyboard shortcuts

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