Repository navigation
v2.0.0
godownload v2.0.0 — a full rewrite of the 2019 library.
Highlights
- Error-based API (breaking change from v1): all methods return
errorinstead oflog.Fatal/panic - Atomic writes: files land under their final name only after a successful write (
.part+ rename) - Resumable downloads:
Rangerequests continue interrupted downloads from the.partfile - Progress callbacks:
OnProgress(transferred, total)with periodic and final notifications - Checksum verification: md5/sha1/sha256/sha512, verified before the file becomes visible
- Rate limiting:
RateLimitin bytes per second (token-bucket) - Multi-segment downloads: parallel ranged segments with per-segment resume, transparent fallback for servers without Range support
- YAML manifests: declarative download lists with per-item overrides and mirror failover (
FromManifest) - context.Context: context-aware variants of every public method
- CLI:
cmd/godownloadwith binaries for linux/darwin/windows (amd64/arm64)
Install
go get github.com/saromanov/godownload@v2.0.0
Or grab a binary from the assets below (checksums in .sha256 files).