mirror of
https://github.com/ipfs/kubo.git
synced 2025-10-28 12:07:19 +08:00
17 lines
389 B
Go
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)
|
|
}
|