Documentation ¶
Index ¶
- Constants
- func CheckMultipart(urls string) (bool, error)
- func GetPipeList(pipeNames ...string) []func(context.Context, *Downloader) error
- func GetSize(urls string) (int64, error)
- func PipeList() map[string]*Pipe
- func PipeRegister(pipe *Pipe)
- func PipeUnregister(ident string)
- type DefaultDownloader
- func (pd *DefaultDownloader) AfterStop() error
- func (pd *DefaultDownloader) BeforeRun(context.Context) error
- func (pd *DefaultDownloader) DoWork(ctx context.Context) (bool, error)
- func (pd DefaultDownloader) GetProgress() model.DownloadProgress
- func (pd *DefaultDownloader) IsPartialDownload() bool
- func (pd *DefaultDownloader) ResetProgress()
- type Downloader
- func (dl *Downloader) GetProgress() []model.DownloadProgress
- func (dl *Downloader) ProgressGetter() func() (downloaded int64, total int64, percentProgress int64, speed int64)
- func (dl *Downloader) RestartAll() []error
- 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 PartialDownloader
- func (pd *PartialDownloader) AfterStop() error
- func (pd *PartialDownloader) AfterStopDownload() error
- func (pd *PartialDownloader) BeforeDownload(ctx context.Context) error
- func (pd *PartialDownloader) BeforeRun(ctx context.Context) error
- func (pd *PartialDownloader) DoWork(ctx context.Context) (bool, error)
- func (pd *PartialDownloader) DownloadSergment(ctx context.Context) (bool, error)
- func (pd PartialDownloader) GetProgress() model.DownloadProgress
- func (pd *PartialDownloader) IsPartialDownload() bool
- func (pd *PartialDownloader) ResetProgress()
- type Pipe
- type PipeFunc
Constants ¶
View Source
const FlushDiskSize = 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func CheckMultipart ¶
func GetPipeList ¶
func GetPipeList(pipeNames ...string) []func(context.Context, *Downloader) error
func PipeRegister ¶
func PipeRegister(pipe *Pipe)
func PipeUnregister ¶
func PipeUnregister(ident string)
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) DoWork ¶
func (pd *DefaultDownloader) DoWork(ctx context.Context) (bool, error)
func (DefaultDownloader) GetProgress ¶
func (pd DefaultDownloader) GetProgress() model.DownloadProgress
func (*DefaultDownloader) IsPartialDownload ¶
func (pd *DefaultDownloader) IsPartialDownload() bool
func (*DefaultDownloader) ResetProgress ¶
func (pd *DefaultDownloader) ResetProgress()
type Downloader ¶
func CreateDownloader ¶
func RestoreDownloader ¶
func RestoreDownloader(url string, fp string, dp []model.DownloadProgress, getDown func() string, pipeNames ...string) (dl *Downloader, err error)
func (*Downloader) GetProgress ¶
func (dl *Downloader) GetProgress() []model.DownloadProgress
func (*Downloader) ProgressGetter ¶
func (dl *Downloader) ProgressGetter() func() (downloaded int64, total int64, percentProgress int64, speed int64)
func (*Downloader) RestartAll ¶
func (dl *Downloader) RestartAll() []error
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(ctx context.Context) error
func (*PartialDownloader) BeforeRun ¶
func (pd *PartialDownloader) BeforeRun(ctx context.Context) error
func (*PartialDownloader) DoWork ¶
func (pd *PartialDownloader) DoWork(ctx context.Context) (bool, error)
func (*PartialDownloader) DownloadSergment ¶
func (pd *PartialDownloader) DownloadSergment(ctx context.Context) (bool, error)
func (PartialDownloader) GetProgress ¶
func (pd PartialDownloader) GetProgress() model.DownloadProgress
func (*PartialDownloader) IsPartialDownload ¶
func (pd *PartialDownloader) IsPartialDownload() bool
func (*PartialDownloader) ResetProgress ¶
func (pd *PartialDownloader) ResetProgress()
Click to show internal directories.
Click to hide internal directories.