Skip to content

storage: support startOffset query during object listing  #2556

@deka108

Description

@deka108

Is your feature request related to a problem? Please describe.
If we have a large number of files stored in the bucket and we only want to list objects starting from a certain prefix, listing objects starting from a specific starting point (under a lexicographical order) would be desirable. This feature is supported in the JSON API via startOffset. However, I could not find a way to set this startOffset value under the go sdk.

Describe the solution you'd like
Support for startOffset when listing objects should be simple. This can be done by:

  1. Add StartOffset field to storage.Query struct
  2. Request changes to internal storage client api to add func (c *BucketsListCall) StartOffset(startOffset string) to modify the url query parameter for startOffset
  3. Modify func (it *ObjectIterator) fetch(pageSize int, pageToken string) to incorporate startOffset parameter if it is being set in the Query, ie. req.StartOffset(it.query.StartOffset)

To use this feature, I should be able to set the StartOffset field in storage.Query to some string value, and expect the internal listObjects call to respect the startOffset and list objects starting from startOffset.

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions