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

docs: Add iterator docs for go-storage #181

Merged
merged 4 commits into from
Aug 10, 2021
Merged

docs: Add iterator docs for go-storage #181

merged 4 commits into from
Aug 10, 2021

Conversation

Xuanwo
Copy link
Contributor

@Xuanwo Xuanwo commented Aug 10, 2021

Fix #95

Signed-off-by: Xuanwo [email protected]

@vercel
Copy link

vercel bot commented Aug 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/beyondstorage/site/DPCFCFAt6MXMP3Pbi3ZNoo7jkZZ4
✅ Preview: https://site-git-iterator-beyondstorage.vercel.app

Signed-off-by: Xuanwo <[email protected]>
Signed-off-by: Xuanwo <[email protected]>
Signed-off-by: Xuanwo <[email protected]>
- In `nextObjectPageByDir`:
- Don't use the `for` loop, our iterator already handles it.
- Don't read the whole list, this will consume too much memory.
- Don't store returned slices in `objectPageStatus`, handle and parse them directly to `page.Data`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly for counting the number of files we don't need to, because we have iterator for next.
objectPageStatusonly needs to store information about directories and files, the rest is optional

@Xuanwo Xuanwo merged commit 77ae224 into master Aug 10, 2021
@Xuanwo Xuanwo deleted the iterator branch August 10, 2021 07:38
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

Successfully merging this pull request may close these issues.

Add docs for Iterator
3 participants