Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
9350c513
提交
9350c513
authored
4月 25, 2017
作者:
Kevin Atkinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
上级
8a47786c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
5 行增加
和
1 行删除
+5
-1
helpers.go
importer/helpers/helpers.go
+1
-0
node.go
merkledag/node.go
+2
-1
dir.go
mfs/dir.go
+1
-0
hamt.go
unixfs/hamt/hamt.go
+1
-0
没有找到文件。
importer/helpers/helpers.go
浏览文件 @
9350c513
...
...
@@ -62,6 +62,7 @@ func NewUnixfsNodeFromDag(nd *dag.ProtoNode) (*UnixfsNode, error) {
},
nil
}
// SetPrefix sets the CID Prefix
func
(
n
*
UnixfsNode
)
SetPrefix
(
prefix
*
cid
.
Prefix
)
{
n
.
node
.
SetPrefix
(
prefix
)
}
...
...
merkledag/node.go
浏览文件 @
9350c513
...
...
@@ -42,6 +42,7 @@ var v1CidPrefix = cid.Prefix{
Version
:
1
,
}
// PrefixForCidVersion returns the Protobuf prefix for a given CID version
func
PrefixForCidVersion
(
version
int
)
(
cid
.
Prefix
,
error
)
{
switch
version
{
case
0
:
...
...
@@ -53,7 +54,7 @@ func PrefixForCidVersion(version int) (cid.Prefix, error) {
}
}
// SetPrefix sets the prefix if it is non nil, if prefix is nil then
// SetPrefix sets the
CID
prefix if it is non nil, if prefix is nil then
// it resets it the default value
func
(
n
*
ProtoNode
)
SetPrefix
(
prefix
*
cid
.
Prefix
)
{
if
prefix
==
nil
{
...
...
mfs/dir.go
浏览文件 @
9350c513
...
...
@@ -58,6 +58,7 @@ func NewDirectory(ctx context.Context, name string, node node.Node, parent child
},
nil
}
// SetPrefix sets the CID prefix
func
(
d
*
Directory
)
SetPrefix
(
prefix
*
cid
.
Prefix
)
{
d
.
dirbuilder
.
SetPrefix
(
prefix
)
}
...
...
unixfs/hamt/hamt.go
浏览文件 @
9350c513
...
...
@@ -125,6 +125,7 @@ func NewHamtFromDag(dserv dag.DAGService, nd node.Node) (*HamtShard, error) {
return
ds
,
nil
}
// SetPrefix sets the CID Prefix
func
(
ds
*
HamtShard
)
SetPrefix
(
prefix
*
cid
.
Prefix
)
{
ds
.
prefix
=
prefix
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论