Documentation ¶
Index ¶
- Constants
- func CheckMultipart(urls string) (bool, error)
- func GetSize(urls string) (int64, error)
- type DefaultDownloader
- type DownloadProgress
- type Downloader
- func (dl *Downloader) GetProgress() []DownloadProgress
- func (dl *Downloader) ProgressGetter() func() (downloaded int64, total int64, percentProgress int64, speed int64)
- func (dl *Downloader) SafeFile() *iotools.SafeFile
- func (dl *Downloader) SetProgressGetter(f func() (downloaded int64, total int64, percentProgress int64, speed int64)) *Downloader
- func (dl *Downloader) StartAll() []error
- func (dl *Downloader) State() monitor.State
- func (dl *Downloader) StopAll() []error
- type FileInfo
- type PartialDownloader
- func (pd *PartialDownloader) AfterStop() error
- func (pd *PartialDownloader) AfterStopDownload() error
- func (pd *PartialDownloader) BeforeDownload() error
- func (pd *PartialDownloader) BeforeRun() error
- func (pd *PartialDownloader) DoWork() (bool, error)
- func (pd *PartialDownloader) DownloadSergment() (bool, error)
- func (pd PartialDownloader) GetProgress() interface{}
Constants ¶
View Source
const FlushDiskSize = 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func CheckMultipart ¶
Types ¶
type DefaultDownloader ¶
type DefaultDownloader struct {
// contains filtered or unexported fields
}
func CreateDefaultDownloader ¶
func CreateDefaultDownloader(url string, file *iotools.SafeFile) *DefaultDownloader
func (*DefaultDownloader) AfterStop ¶
func (pd *DefaultDownloader) AfterStop() error
func (*DefaultDownloader) BeforeRun ¶
func (pd *DefaultDownloader) BeforeRun() error
func (*DefaultDownloader) DoWork ¶
func (pd *DefaultDownloader) DoWork() (bool, error)
func (DefaultDownloader) GetProgress ¶
func (pd DefaultDownloader) GetProgress() interface{}
type DownloadProgress ¶
type Downloader ¶
type Downloader struct { Fi FileInfo // contains filtered or unexported fields }
func CreateDownloader ¶
func CreateDownloader(url string, fp string, seg int64, getDown func() string, pipes ...func(*Downloader) error) (dl *Downloader, err error)
func RestoreDownloader ¶
func RestoreDownloader(url string, fp string, dp []DownloadProgress, getDown func() string, pipes ...func(*Downloader) error) (dl *Downloader, err error)
func (*Downloader) GetProgress ¶
func (dl *Downloader) GetProgress() []DownloadProgress
func (*Downloader) ProgressGetter ¶
func (dl *Downloader) ProgressGetter() func() (downloaded int64, total int64, percentProgress int64, speed int64)
func (*Downloader) SafeFile ¶
func (dl *Downloader) SafeFile() *iotools.SafeFile
func (*Downloader) SetProgressGetter ¶
func (dl *Downloader) SetProgressGetter(f func() (downloaded int64, total int64, percentProgress int64, speed int64)) *Downloader
func (*Downloader) StartAll ¶
func (dl *Downloader) StartAll() []error
func (*Downloader) State ¶
func (dl *Downloader) State() monitor.State
func (*Downloader) StopAll ¶
func (dl *Downloader) StopAll() []error
type PartialDownloader ¶
type PartialDownloader struct {
// contains filtered or unexported fields
}
func CreatePartialDownloader ¶
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{}
Click to show internal directories.
Click to hide internal directories.