-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented resumable downloads #26
Conversation
/update-branch |
…t/mmetl into resumable-attachment-downloads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is neat, I really enjoyed reading your code 🤓
I left some comments below, mostly nits, but also some about things I don't understand. I have a couple of general comments, too:
- Is it possible to test the functions in
download.go
? They seem brittle to any future change, so I'd love to have some assertions to ensure behavior is not changed accidentally in the future. - Can we wrap the errors (when we just do
return err
) to give them a bit more context to what happened?
Thank you for your work on this, Tim! :)
Oh, and also: thank you for the diagram in the PR description, it helped me understand the big picture (and now that I'm writing this I'm thinking that it would be good to add it as a comment in the |
I'll look into the tests. It should be possible to "fake" the request. I'll also look into the error wrapping. |
I've added tests and wrapped all returned error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Great tests, thank you 🙏
Summary
This PR adds download resume functionality to
mmetl
.It verifies the download by adding a small overlap with the existing file and comparing the first 512 bytes.
The HTTP client now identifies itself via the User-Agent "mmetl/1.0".