Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
6ae0973e
提交
6ae0973e
authored
10月 04, 2015
作者:
rht
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add context to coreunix.Cat argument
License: MIT Signed-off-by:
rht
<
rhtbot@gmail.com
>
上级
f70846fe
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
11 行增加
和
10 行删除
+11
-10
cat.go
core/commands/cat.go
+1
-1
cat.go
core/coreunix/cat.go
+4
-3
ipfs_test.go
fuse/readonly/ipfs_test.go
+1
-1
addcat_test.go
test/integration/addcat_test.go
+1
-1
bench_cat_test.go
test/integration/bench_cat_test.go
+1
-1
grandcentral_test.go
test/integration/grandcentral_test.go
+1
-1
three_legged_cat_test.go
test/integration/three_legged_cat_test.go
+1
-1
main.go
test/supernode_client/main.go
+1
-1
没有找到文件。
core/commands/cat.go
浏览文件 @
6ae0973e
...
...
@@ -67,7 +67,7 @@ func cat(ctx context.Context, node *core.IpfsNode, paths []string) ([]io.Reader,
readers
:=
make
([]
io
.
Reader
,
0
,
len
(
paths
))
length
:=
uint64
(
0
)
for
_
,
fpath
:=
range
paths
{
read
,
err
:=
coreunix
.
Cat
(
node
,
fpath
)
read
,
err
:=
coreunix
.
Cat
(
ctx
,
node
,
fpath
)
if
err
!=
nil
{
return
nil
,
0
,
err
}
...
...
core/coreunix/cat.go
浏览文件 @
6ae0973e
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
(
n
*
core
.
IpfsNode
,
pstr
string
)
(
*
uio
.
DagReader
,
error
)
{
func
Cat
(
ctx
context
.
Context
,
n
*
core
.
IpfsNode
,
pstr
string
)
(
*
uio
.
DagReader
,
error
)
{
p
:=
path
.
FromString
(
pstr
)
dagNode
,
err
:=
n
.
Resolver
.
ResolvePath
(
n
.
Context
()
,
p
)
dagNode
,
err
:=
n
.
Resolver
.
ResolvePath
(
ctx
,
p
)
if
err
!=
nil
{
return
nil
,
err
}
return
uio
.
NewDagReader
(
n
.
Context
()
,
dagNode
,
n
.
DAG
)
return
uio
.
NewDagReader
(
ctx
,
dagNode
,
n
.
DAG
)
}
fuse/readonly/ipfs_test.go
浏览文件 @
6ae0973e
...
...
@@ -168,7 +168,7 @@ func TestIpfsStressRead(t *testing.T) {
t
.
Fatal
(
err
)
}
read
,
err
:=
coreunix
.
Cat
(
nd
,
item
)
read
,
err
:=
coreunix
.
Cat
(
nd
.
Context
(),
nd
,
item
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
test/integration/addcat_test.go
浏览文件 @
6ae0973e
...
...
@@ -138,7 +138,7 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error {
return
err
}
readerCatted
,
err
:=
coreunix
.
Cat
(
catter
,
added
)
readerCatted
,
err
:=
coreunix
.
Cat
(
c
tx
,
c
atter
,
added
)
if
err
!=
nil
{
return
err
}
...
...
test/integration/bench_cat_test.go
浏览文件 @
6ae0973e
...
...
@@ -84,7 +84,7 @@ func benchCat(b *testing.B, data []byte, conf testutil.LatencyConfig) error {
}
b
.
StartTimer
()
readerCatted
,
err
:=
coreunix
.
Cat
(
catter
,
added
)
readerCatted
,
err
:=
coreunix
.
Cat
(
c
tx
,
c
atter
,
added
)
if
err
!=
nil
{
return
err
}
...
...
test/integration/grandcentral_test.go
浏览文件 @
6ae0973e
...
...
@@ -62,7 +62,7 @@ func RunSupernodeBootstrappedAddCat(data []byte, conf testutil.LatencyConfig) er
return
err
}
readerCatted
,
err
:=
coreunix
.
Cat
(
catter
,
keyAdded
)
readerCatted
,
err
:=
coreunix
.
Cat
(
c
tx
,
c
atter
,
keyAdded
)
if
err
!=
nil
{
return
err
}
...
...
test/integration/three_legged_cat_test.go
浏览文件 @
6ae0973e
...
...
@@ -117,7 +117,7 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error {
return
err
}
readerCatted
,
err
:=
coreunix
.
Cat
(
catter
,
added
)
readerCatted
,
err
:=
coreunix
.
Cat
(
c
tx
,
c
atter
,
added
)
if
err
!=
nil
{
return
err
}
...
...
test/supernode_client/main.go
浏览文件 @
6ae0973e
...
...
@@ -199,7 +199,7 @@ func runFileCattingWorker(ctx context.Context, n *core.IpfsNode) error {
"localPeer"
:
n
.
Identity
,
}
}))
if
r
,
err
:=
coreunix
.
Cat
(
n
,
k
);
err
!=
nil
{
if
r
,
err
:=
coreunix
.
Cat
(
ctx
,
n
,
k
);
err
!=
nil
{
e
.
Done
()
log
.
Printf
(
"failed to cat file. seed: %d #%d key: %s err: %s"
,
*
seed
,
i
,
k
,
err
)
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论