feat(ftp): implement FTP client with URL parsing, REST detection, chunked downloads #133
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget!133
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ftp-client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement FTP client wrapper using
github.com/jlaffaye/ftp. Supports URL parsing, anonymous login, SIZE detection, REST capability probing, and both parallel (RetrFrom) and single-threaded (Retr) downloads.Why
Enables FTP downloads as a core protocol alongside HTTP. REST detection allows parallel chunked downloads when available, with graceful fallback to single-stream.
Testing
go vet ./...passesgo build ./...passesgolangci-lint run ./...passesBreaking Changes
None
Notes
ParseFTPURL— extracts host, port, path, user, password fromftp://URLsDialFTP— connects with configurable timeoutLoginFTP— anonymous by default (user:anonymous, pass:anonymous@)GetFTPFileSize— sendsSIZEcommand, falls back to RETR to measureSupportsREST— probes viaRetrFromat offset 1, returns boolProbeFTP— full probe returning size + REST supportDownloadFTPRange— usesRetrFrom(offset)for chunked parallel downloadsDownloadFTPSingle— wrapper aroundDownloadFTPRangewith offset 0ftpReadCloser— wrapsftp.Response+ServerConnfor cleanio.ReadCloserinterfaceCloses #0032
Closes #0033
Closes #0034
Closes #0035
Closes #0036
Closes #0037
Closes #0038
Closes #0039
Review: APPROVED
Verification
go vet ./...— ✅ passesgo build ./...— ✅ passesgolangci-lint v2 run ./...— ✅ 0 issuesChanges
internal/downloader/ftp.go(new, 171 lines) — FTP client: URL parsing, dial/login, SIZE/REST probe, range download, single download, ftpReadCloser wrapperROADMAP.md— Marks Phase 2 FTP items as [x]Suggestions (non-blocking)
ftps://scheme accepted but TLS not implemented; confusing dial failureProbeFTPreturns wrong error when both SIZE and RETR fallback failCloses #0032, #0033, #0034, #0035, #0036, #0037, #0038, #0039 on merge.
ftp://user:pass@host/pathURLs #94