ipfs / go-unixfsnode

An ADL IPLD prime node that wraps go-codec-dagpb's implementation of protobuf to enable pathing
Other
11 stars 5 forks source link

Add example use cases #22

Open gmelodie opened 2 years ago

gmelodie commented 2 years ago

This seems like exactly what I'm looking for, however there are no docs or instructions that help me to use this code. It'd be helpful to have a few code snippets showing how to use this code to build interesting things. I think this would be very helpful to other people as well.

willscott commented 2 years ago

https://github.com/ipld/go-car/blob/master/cmd/car/create.go might be a reasonable place to start if you haven't seen that one yet

gmelodie commented 2 years ago

So what I was looking for was how to recursively list all files under a directory in IPFS given its CID, but I'm having a hard time navigating the codebase. I think it'd be much easier if you had example snippets.

willscott commented 2 years ago

That's a much higher level operation than what this specific library will provide, so this is probably not the right place for such an example

willscott commented 2 years ago

in particular, because this library only works with data already in ipld format, and an actual example needs to engage with getting that data from a blockstore, which is more of the work than the interpretation of the data provided by this library

gmelodie commented 2 years ago

Just because this is a lower level library doesn't mean it wouldn't benefit from example code snippets. Code snippets/examples can include other libraries and how to work with them. In fact, that's exactly what I'm trying to figure out.