Versions in this module Expand all Collapse all v0 v0.8.0 Apr 11, 2026 Changes in this version type RuntimeConfig + CustomDNS string v0.7.8 Apr 4, 2026 Changes in this version + type CancelResult struct + Completed bool + DestPath string + Filename string + Found bool + WasQueued bool v0.7.7 Apr 2, 2026 v0.7.6 Apr 2, 2026 Changes in this version + const AlignSize + const DefaultExpectContinueTimeout + const DefaultIdleConnTimeout + const DefaultMaxIdleConns + const DefaultResponseHeaderTimeout + const DefaultTLSHandshakeTimeout + const DialTimeout + const GB + const HealthCheckInterval + const IncompleteSuffix + const KB + const KeepAliveDuration + const MB + const MaxTaskRetries + const MinChunk + const PerHostMax + const ProbeTimeout + const ProgressChannelBuffer + const RetryBaseDelay + const SlowWorkerGrace + const SlowWorkerThreshold + const SpeedEMAAlpha + const StallTimeout + const WorkerBatchInterval + const WorkerBatchSize + const WorkerBuffer + var ErrPaused = errors.New("download paused") + type ChunkStatus int + const ChunkCompleted + const ChunkDownloading + const ChunkPending + type DownloadConfig struct + DestPath string + Filename string + Headers map[string]string + ID string + IsExplicitCategory bool + IsResume bool + Mirrors []string + OutputPath string + ProgressCh chan<- any + Runtime *RuntimeConfig + SavedState *DownloadState + State *ProgressState + SupportsRange bool + TotalSize int64 + URL string + type DownloadEntry struct + AvgSpeed float64 + CompletedAt int64 + DestPath string + Downloaded int64 + Filename string + ID string + Mirrors []string + Status string + TimeTaken int64 + TotalSize int64 + URL string + URLHash string + type DownloadState struct + ActualChunkSize int64 + ChunkBitmap []byte + CreatedAt int64 + DestPath string + Downloaded int64 + Elapsed int64 + FileHash string + Filename string + ID string + Mirrors []string + PausedAt int64 + Tasks []Task + TotalSize int64 + URL string + URLHash string + type DownloadStatus struct + AddedAt int64 + AvgSpeed float64 + Connections int + DestPath string + Downloaded int64 + ETA int64 + Error string + Filename string + ID string + Progress float64 + Speed float64 + Status string + TimeTaken int64 + TotalSize int64 + URL string + type MasterList struct + Downloads []DownloadEntry + type MirrorStatus struct + Active bool + Error bool + URL string + type ProgressState struct + ActiveWorkers atomic.Int32 + ActualChunkSize int64 + BitmapWidth int + ChunkBitmap []byte + ChunkProgress []int64 + DestPath string + Done atomic.Bool + Downloaded atomic.Int64 + Error atomic.Pointer[error] + Filename string + ID string + Mirrors []MirrorStatus + Paused atomic.Bool + Pausing atomic.Bool + SavedElapsed time.Duration + SessionStartBytes int64 + StartTime time.Time + TotalSize int64 + URL string + VerifiedProgress atomic.Int64 + func NewProgressState(id string, totalSize int64) *ProgressState + func (ps *ProgressState) FinalizePauseSession(downloaded int64) time.Duration + func (ps *ProgressState) FinalizeSession(downloaded int64) (time.Duration, time.Duration) + func (ps *ProgressState) GetBitmap() ([]byte, int, int64, int64, []int64) + func (ps *ProgressState) GetBitmapSnapshot(includeProgress bool) ([]byte, int, int64, int64, []int64) + func (ps *ProgressState) GetChunkState(index int) ChunkStatus + func (ps *ProgressState) GetDestPath() string + func (ps *ProgressState) GetError() error + func (ps *ProgressState) GetFilename() string + func (ps *ProgressState) GetMirrors() []MirrorStatus + func (ps *ProgressState) GetProgress() (downloaded int64, total int64, totalElapsed time.Duration, ...) + func (ps *ProgressState) GetSavedElapsed() time.Duration + func (ps *ProgressState) GetURL() string + func (ps *ProgressState) InitBitmap(totalSize int64, chunkSize int64) + func (ps *ProgressState) IsPaused() bool + func (ps *ProgressState) IsPausing() bool + func (ps *ProgressState) Pause() + func (ps *ProgressState) RecalculateProgress(remainingTasks []Task) + func (ps *ProgressState) RestoreBitmap(bitmap []byte, actualChunkSize int64) + func (ps *ProgressState) Resume() + func (ps *ProgressState) SetCancelFunc(cancel context.CancelFunc) + func (ps *ProgressState) SetChunkProgress(progress []int64) + func (ps *ProgressState) SetChunkState(index int, status ChunkStatus) + func (ps *ProgressState) SetDestPath(path string) + func (ps *ProgressState) SetError(err error) + func (ps *ProgressState) SetFilename(filename string) + func (ps *ProgressState) SetMirrors(mirrors []MirrorStatus) + func (ps *ProgressState) SetPausing(pausing bool) + func (ps *ProgressState) SetSavedElapsed(d time.Duration) + func (ps *ProgressState) SetTotalSize(size int64) + func (ps *ProgressState) SetURL(url string) + func (ps *ProgressState) SyncSessionStart() + func (ps *ProgressState) UpdateChunkStatus(offset, length int64, status ChunkStatus) + type RuntimeConfig struct + MaxConnectionsPerHost int + MaxTaskRetries int + MinChunkSize int64 + ProxyURL string + SequentialDownload bool + SlowWorkerGracePeriod time.Duration + SlowWorkerThreshold float64 + SpeedEmaAlpha float64 + StallTimeout time.Duration + UserAgent string + WorkerBufferSize int + func ConvertRuntimeConfig(rc *config.RuntimeConfig) *RuntimeConfig + func (r *RuntimeConfig) GetMaxConnectionsPerHost() int + func (r *RuntimeConfig) GetMaxTaskRetries() int + func (r *RuntimeConfig) GetMinChunkSize() int64 + func (r *RuntimeConfig) GetSlowWorkerGracePeriod() time.Duration + func (r *RuntimeConfig) GetSlowWorkerThreshold() float64 + func (r *RuntimeConfig) GetSpeedEmaAlpha() float64 + func (r *RuntimeConfig) GetStallTimeout() time.Duration + func (r *RuntimeConfig) GetUserAgent() string + func (r *RuntimeConfig) GetWorkerBufferSize() int + type Task struct + Length int64 + Offset int64 + SharedMaxOffset *atomic.Int64