示例#1
0
文件: get.go 项目: shuanzi/go-ipfs
func get(ctx context.Context, node *core.IpfsNode, p path.Path, compression int) (io.Reader, error) {
	dagnode, err := core.Resolve(ctx, node, p)
	if err != nil {
		return nil, err
	}

	return utar.NewReader(ctx, p, node.DAG, dagnode, compression)
}
示例#2
0
文件: get.go 项目: avbalu/go-ipfs
func get(ctx context.Context, node *core.IpfsNode, p string, compression int) (io.Reader, error) {
	pathToResolve := path.Path(p)
	dagnode, err := core.Resolve(ctx, node, pathToResolve)
	if err != nil {
		return nil, err
	}

	return utar.NewReader(pathToResolve, node.DAG, dagnode, compression)
}