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

Implement the ability to index a CAR using io.Reader alone for both v1 and v2 #146

Closed
masih opened this issue Jul 8, 2021 · 1 comment · Fixed by #161
Closed

Implement the ability to index a CAR using io.Reader alone for both v1 and v2 #146

masih opened this issue Jul 8, 2021 · 1 comment · Fixed by #161
Assignees
Milestone

Comments

@masih
Copy link
Member

masih commented Jul 8, 2021

there should be a way to do this on just an io.Reader without ever needing to seek, but we would end up needing to use internal functions to jump to the internal (post-header) portion of index generation when we encounter a car v1 header.

Seeker is also used to skip over blocks during indexing. Nevertheless, i can imagine situations where you're streaming a car onto disk, and want to generate an index while you're at it. Being able to pipe through this with just an io.Reader is likely the way you'd hope to do that, so we should eventually relax the interface here to what we actually need.

Originally posted by @willscott in #144 (comment)

@masih masih added this to the CAR v2 milestone Jul 8, 2021
@masih masih self-assigned this Jul 13, 2021
@masih masih linked a pull request Jul 15, 2021 that will close this issue
masih added a commit that referenced this issue Jul 15, 2021
Implement the ability to generate index from a CARv1 payload given only
an `io.Reader`, where the previous implementation required
`io.ReadSeeker`. The rationale is to be minimal in what we expect in the
API, since index generation from a CARv1 payload never need to rewind
the reader and only moves forward in the stream.

Refactor utility IO functions that convert between types in one place.
Implement constructor functions that only instantiate wrappers when the
passed argument does not satisfy a required interface.

Fixes:
- #146

Relates to:
- #145
@masih
Copy link
Member Author

masih commented Jul 15, 2021

Fixed in #161

@masih masih closed this as completed Jul 15, 2021
mvdan pushed a commit that referenced this issue Jul 16, 2021
Implement the ability to generate index from a CARv1 payload given only
an `io.Reader`, where the previous implementation required
`io.ReadSeeker`. The rationale is to be minimal in what we expect in the
API, since index generation from a CARv1 payload never need to rewind
the reader and only moves forward in the stream.

Refactor utility IO functions that convert between types in one place.
Implement constructor functions that only instantiate wrappers when the
passed argument does not satisfy a required interface.

Fixes:
- #146

Relates to:
- #145
Jorropo pushed a commit to ipfs/boxo that referenced this issue Mar 22, 2023
Implement the ability to generate index from a CARv1 payload given only
an `io.Reader`, where the previous implementation required
`io.ReadSeeker`. The rationale is to be minimal in what we expect in the
API, since index generation from a CARv1 payload never need to rewind
the reader and only moves forward in the stream.

Refactor utility IO functions that convert between types in one place.
Implement constructor functions that only instantiate wrappers when the
passed argument does not satisfy a required interface.

Fixes:
- ipld/go-car#146

Relates to:
- ipld/go-car#145


This commit was moved from ipld/go-car@6b085bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant