提交 9350c513 作者: Kevin Atkinson

Documentation

License: MIT
Signed-off-by: 's avatarKevin Atkinson <k@kevina.org>
上级 8a47786c
......@@ -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)
}
......
......@@ -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 {
......
......@@ -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)
}
......
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论