Implement a streaming read only IPLD native storage #349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goals
Start to implement CARv2 IPLD Storage native interfaces
Implementation
So this is definitely just an experiment, but I think it revealed some tangled dependencies in go-car/v2 blockstore interfaces.
Essentially, all I wanted to do was implement a go-ipld-prime
ReadableStorage
interface as defined here but I also wanted support for native read streaming -- https://github.com/ipld/go-ipld-prime/blob/master/storage/api.go#L91 -- cause I think this is an interesting use case.To implement the streaming
GetStream
I needed lower level access to the car components, but if I implemented in a seperate package it was tough to get all the functionality of the blockstore interfaces.I think maybe there's common wrapper code to extract? I dunno I didn't want to do a bunch of refactors.
Ultimately, this was for a particular use case I wanted to try -- I'm not convinced it can be easily written outside the go-car/v2 package, but I'm not not convinced it shouldn't be done that way.