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

commands/object: remove objectData() and objectLinks() helpers resolver: added context parameters sharness: $HASH carried the \r from the http protocol with sharness: write curl output to individual files http gw: break PUT handler until PR#1191
19 lines
417 B
Go
19 lines
417 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(n.ContextGroup.Context(), p)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return uio.NewDagReader(n.ContextGroup.Context(), dagNode, n.DAG)
|
|
}
|