Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

UnixFS reading (or exporter) #172

Closed
6 tasks done
koivunej opened this issue May 25, 2020 · 2 comments · Fixed by #189
Closed
6 tasks done

UnixFS reading (or exporter) #172

koivunej opened this issue May 25, 2020 · 2 comments · Fixed by #189
Assignees

Comments

@koivunej
Copy link
Collaborator

koivunej commented May 25, 2020

UnixFS as in UnixFSv1.5 reading per https://github.com/ipfs/specs/blob/master/UNIXFS.md.

  • reading single-block files
  • reading files with arbitary trees
  • reading directories and files under them
  • reading symlinks
  • http: /cat
  • http: /get
@koivunej koivunej self-assigned this May 25, 2020
@koivunej
Copy link
Collaborator Author

koivunej commented Jun 1, 2020

I am still looking into getting the third working, then work on the /cat. There doesn't seem to be much of an issue into making this into a fn reader(block: &'a [u8]) -> SomeReader<'a> but that will leave the block reading into the hands of the caller, similar to how refs is handled at the moment over at http. The "block reading" or "link following" has some things to handle as well, such as size validation. I am expecting this to be wrangleable into something like:

pub async fn cat_unixfs(&self, path: impl Into<IpfsPath>, slice: Option<Range<u64>>) -> 
  Result<impl TryStream<Ok = SomeBytes, Error = UnixFsError>, ipfs::Error>;

cat operation is more simple than the get as it can only cat files and maybe symlinks if I understand correctly.

Hopefully this will allow supporting many different blockstore/persistence appoaches.

I haven't still done but the preliminary work on tar support at /get, and I am also a bit unsure how to represent a async fn get_unixfs(&self, path: impl Into<IpfsPath>) -> Result<impl TryStream<Ok = ???, Error = _>, _> as the TryStream::Ok must be able to contain multiple further Streams.

This was referenced Jun 4, 2020
@koivunej koivunej linked a pull request Jun 17, 2020 that will close this issue
3 tasks
@koivunej
Copy link
Collaborator Author

Related js-ipfs PR: ipfs/js-ipfs#3093

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

Successfully merging a pull request may close this issue.

1 participant