1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

make path resolver no longer require whole node for construction

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
Jeromy
2016-10-19 10:05:58 -07:00
parent 1c6e84ce7c
commit 67c2a4ec14
23 changed files with 161 additions and 50 deletions

View File

@ -12,6 +12,7 @@ import (
merkledag "github.com/ipfs/go-ipfs/merkledag"
path "github.com/ipfs/go-ipfs/path"
unixfs "github.com/ipfs/go-ipfs/unixfs"
uio "github.com/ipfs/go-ipfs/unixfs/io"
unixfspb "github.com/ipfs/go-ipfs/unixfs/pb"
)
@ -87,7 +88,13 @@ possible, please use 'ipfs ls' instead.
for _, fpath := range paths {
ctx := req.Context()
merkleNode, err := core.Resolve(ctx, node, path.Path(fpath))
resolver := &path.Resolver{
DAG: node.DAG,
ResolveOnce: uio.ResolveUnixfsOnce,
}
merkleNode, err := core.Resolve(ctx, node.Namesys, resolver, path.Path(fpath))
if err != nil {
res.SetError(err, cmds.ErrNormal)
return