go-ipfs-http-client
go-ipfs-http-client copied to clipboard
Use CoreAPI within `Unixfs().Get()`
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.
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.
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