1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 14:34:24 +08:00
Files
kubo/core/coreunix/cat.go
rht 31115f51a0 Allow ipfs cat on ipns path
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-10-31 15:55:47 +07:00

17 lines
455 B
Go

package coreunix
import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
core "github.com/ipfs/go-ipfs/core"
path "github.com/ipfs/go-ipfs/path"
uio "github.com/ipfs/go-ipfs/unixfs/io"
)
func Cat(ctx context.Context, n *core.IpfsNode, pstr string) (*uio.DagReader, error) {
dagNode, err := core.Resolve(ctx, n, path.Path(pstr))
if err != nil {
return nil, err
}
return uio.NewDagReader(ctx, dagNode, n.DAG)
}