1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-15 11:13:37 +08:00
Files
kubo/core/coreunix/cat.go
Ho-Sheng Hsiao bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00

19 lines
391 B
Go

package coreunix
import (
"io"
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) (io.Reader, error) {
p := path.FromString(pstr)
dagNode, err := n.Resolver.ResolvePath(p)
if err != nil {
return nil, err
}
return uio.NewDagReader(n.ContextGroup.Context(), dagNode, n.DAG)
}