1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-10-28 12:07:19 +08:00
Files
kubo/core/coreunix/cat.go
rht a7f43de5f2 Cleanup coreunix cat
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-27 17:13:34 +07:00

17 lines
389 B
Go

package coreunix
import (
core "github.com/ipfs/go-ipfs/core"
path "github.com/ipfs/go-ipfs/path"
uio "github.com/ipfs/go-ipfs/unixfs/io"
)
func Cat(n *core.IpfsNode, pstr string) (*uio.DagReader, error) {
p := path.FromString(pstr)
dagNode, err := n.Resolver.ResolvePath(n.Context(), p)
if err != nil {
return nil, err
}
return uio.NewDagReader(n.Context(), dagNode, n.DAG)
}