Versions in this module Expand all Collapse all v1 v1.2.0 Dec 4, 2022 Changes in this version + type BrokenDownloadError struct + func (e BrokenDownloadError) Error() string + type CancelledDownloadError string + func (e CancelledDownloadError) Error() string type Download + Id string + Segments []Segment + type FilesystemError string + func (e FilesystemError) Error() string + type IOCopyError string + func (e IOCopyError) Error() string + type InvalidFilenameError struct + func (e InvalidFilenameError) Error() string + type Manager struct + func NewManager(fs afero.Fs) *Manager + func (m *Manager) DeleteDownloadById(id string) error + func (m *Manager) GetDownloadById(id string) (*Download, error) + func (m *Manager) GetDownloadByUrl(url string) (*Download, error) + func (m *Manager) ListDownloads() ([]*Download, error) + func (m *Manager) StartDownload(file *Download, ctx context.Context) error + type NetworkError string + func (e NetworkError) Error() string + type NonexistentDownloadError struct + func (e NonexistentDownloadError) Error() string + type Segment struct + End int64 + Id uint8 + Start int64 + func (s *Segment) Download(url string, position int64, writer io.Writer, ctx context.Context) error + func (s *Segment) Filename() string + type SegmentDownloader interface + Download func(writer io.Writer, offset int64, ctx context.Context) + Filename func() string + type SegmentOverflowError struct + func (e SegmentOverflowError) Error() string + type WorkerError string + func (e WorkerError) Error() string v1.1.0 Aug 27, 2022 Changes in this version + var ErrDownloadBroken = errors.New("download is broken") + var ErrDownloadNotExist = errors.New("download does not exist") + var ErrDownloadNotResumable = errors.New("download is not resumable") + type Download struct + ETag string + ID string + Name string + Resumable bool + Size int64 + URL string + Workers []*Worker + func GetDownload(downloadID string) (*Download, error) + func ListDownloads() ([]*Download, error) + func NewDownload(downloadURL string, workerCount int) (*Download, error) + func (d *Download) Delete() error + func (d *Download) Execute(ctx context.Context) error + func (d *Download) FilePath() string + func (d *Download) FolderPath() string + func (d *Download) OutputFilePath() string + func (d *Download) Save() error + func (d *Download) String() string + type Worker struct + EndPoint int64 + ID int + StartingPoint int64 + func NewWorker(workerIndex int, download *Download) *Worker + func (w *Worker) Execute(ctx context.Context, bar *pb.ProgressBar) error