Skip to content
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

Download range of object? #132

Open
shelbyd opened this issue Oct 11, 2023 · 0 comments
Open

Download range of object? #132

shelbyd opened this issue Oct 11, 2023 · 0 comments

Comments

@shelbyd
Copy link

shelbyd commented Oct 11, 2023

I would like the ability to optionally only download a specific range of an Object. GCS supports this in HTTP downloads with a Range header (https://cloud.google.com/storage/docs/xml-api/get-object-download#request_headers), and in their official libraries with ranges as part of the download parameters.

As far as interface, it would be nice to have the range as an argument to ObjectClient::download. Something like:

async fn download(&self, bucket: &str, file_name: &str, range: impl Into<Option<core::ops::RangeInclusive<u64>>>)

That is a breaking change, so we could additionally define a download_range fn. But that increases bloat, assuming you'd also want download_range_sync.

It's possible I could do this myself with download_url, but I don't want to create signed urls unnecessarily. I could also inline the implementation and do everything myself, but then why use a library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant