Documentation
¶
Index ¶
- func Download(ctx context.Context, url string, outPath string, progressCh chan<- any, ...) error
- func TUIDownload(ctx context.Context, cfg *types.DownloadConfig) error
- type ProbeResult
- type WorkerPool
- func (p *WorkerPool) ActiveCount() int
- func (p *WorkerPool) Add(cfg types.DownloadConfig)
- func (p *WorkerPool) Cancel(downloadID string)
- func (p *WorkerPool) GetAll() []types.DownloadConfig
- func (p *WorkerPool) GetStatus(id string) *types.DownloadStatus
- func (p *WorkerPool) GracefulShutdown()
- func (p *WorkerPool) HasDownload(url string) bool
- func (p *WorkerPool) Pause(downloadID string) bool
- func (p *WorkerPool) PauseAll()
- func (p *WorkerPool) Resume(downloadID string) bool
- func (p *WorkerPool) UpdateURL(downloadID string, newURL string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(ctx context.Context, url string, outPath string, progressCh chan<- any, id string) error
Download is the CLI entry point (non-TUI) - convenience wrapper
func TUIDownload ¶
func TUIDownload(ctx context.Context, cfg *types.DownloadConfig) error
TUIDownload is the main entry point for downloads executed by the Engine pool
Types ¶
type ProbeResult ¶
ProbeResult contains all metadata from server probe
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(progressCh chan<- any, maxDownloads int) *WorkerPool
func (*WorkerPool) ActiveCount ¶
func (p *WorkerPool) ActiveCount() int
ActiveCount returns the number of currently active (downloading/pausing) downloads
func (*WorkerPool) Add ¶
func (p *WorkerPool) Add(cfg types.DownloadConfig)
Add adds a new download task to the pool
func (*WorkerPool) Cancel ¶
func (p *WorkerPool) Cancel(downloadID string)
Cancel cancels and removes a download by ID
func (*WorkerPool) GetAll ¶
func (p *WorkerPool) GetAll() []types.DownloadConfig
GetAll returns all active download configs (for listing)
func (*WorkerPool) GetStatus ¶
func (p *WorkerPool) GetStatus(id string) *types.DownloadStatus
GetStatus returns the status of an active download
func (*WorkerPool) GracefulShutdown ¶
func (p *WorkerPool) GracefulShutdown()
GracefulShutdown pauses all downloads and waits for them to save state
func (*WorkerPool) HasDownload ¶
func (p *WorkerPool) HasDownload(url string) bool
HasDownload reports whether a download with the given URL is currently active or queued in the pool.
func (*WorkerPool) Pause ¶
func (p *WorkerPool) Pause(downloadID string) bool
Pause pauses a specific download by ID. Returns true if found and pause initiated (or already paused), false otherwise.
func (*WorkerPool) PauseAll ¶
func (p *WorkerPool) PauseAll()
PauseAll pauses all active downloads (for graceful shutdown)
func (*WorkerPool) Resume ¶
func (p *WorkerPool) Resume(downloadID string) bool
Resume resumes a paused download by ID. Returns true if found and resumed (or already running), false otherwise.