go-ipfs-http-client icon indicating copy to clipboard operation
go-ipfs-http-client copied to clipboard

Use CoreAPI within `Unixfs().Get()`

Open Stebalien opened this issue 5 years ago • 2 comments

Currently, this directly invokes the ls HTTP API endpoint but that means we need to duplicate some logic. It would be nice if we could just call Unixfs().Ls() and use that.

Stebalien avatar Mar 26 '19 18:03 Stebalien

Hello @Stebalien I'm so exciting to work with IPFS I'm trying to find what this issue about I found that we are able to use Unixfs().Get() normally as you can find in this Gist https://gist.github.com/tarekbadrshalaan/3efa2d69d169d00dc5d717e9afa1b284#file-use_go-ipfs-http-client-go-L24

so please try to explain more and I will work on it.

tarekbadrsh avatar Jun 01 '19 10:06 tarekbadrsh

This issue is about refactoring Unixfs().Get() to use Unixfs().Ls() instead of manually calling ls:

https://github.com/ipfs/go-ipfs-http-client/blob/6062f4dc5c9edafa6f1b8301e420b8439588f2fa/apifile.go#L228-L231

That way, we don't need to re-implement decoding ls here:

https://github.com/ipfs/go-ipfs-http-client/blob/6062f4dc5c9edafa6f1b8301e420b8439588f2fa/apifile.go#L147-L196

Stebalien avatar Jun 01 '19 15:06 Stebalien