@cryptotaxi247 / kubo / commits / 9350c513f

Documentation

License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>

Kevin Atkinson committed Apr 25, 2017 at 23:47 UTC 9350c513f14dadb6226bee9dc81c1486f53a5b91
4 files changed +5 -1
importer/helpers/helpers.go
+1
@@ -62,6 +62,7 @@ func NewUnixfsNodeFromDag(nd *dag.ProtoNode) (*UnixfsNode, error) {
62 }, nil
63 }
64
65 +// SetPrefix sets the CID Prefix
66 func (n *UnixfsNode) SetPrefix(prefix *cid.Prefix) {
67 n.node.SetPrefix(prefix)
68 }
merkledag/node.go
+2 -1
@@ -42,6 +42,7 @@ var v1CidPrefix = cid.Prefix{
42 Version: 1,
43 }
44
45 +// PrefixForCidVersion returns the Protobuf prefix for a given CID version
46 func PrefixForCidVersion(version int) (cid.Prefix, error) {
47 switch version {
48 case 0:
@@ -53,7 +54,7 @@ func PrefixForCidVersion(version int) (cid.Prefix, error) {
54 }
55 }
56
56 -// SetPrefix sets the prefix if it is non nil, if prefix is nil then
57 +// SetPrefix sets the CID prefix if it is non nil, if prefix is nil then
58 // it resets it the default value
59 func (n *ProtoNode) SetPrefix(prefix *cid.Prefix) {
60 if prefix == nil {
mfs/dir.go
+1
@@ -58,6 +58,7 @@ func NewDirectory(ctx context.Context, name string, node node.Node, parent child
58 }, nil
59 }
60
61 +// SetPrefix sets the CID prefix
62 func (d *Directory) SetPrefix(prefix *cid.Prefix) {
63 d.dirbuilder.SetPrefix(prefix)
64 }
unixfs/hamt/hamt.go
+1
@@ -125,6 +125,7 @@ func NewHamtFromDag(dserv dag.DAGService, nd node.Node) (*HamtShard, error) {
125 return ds, nil
126 }
127
128 +// SetPrefix sets the CID Prefix
129 func (ds *HamtShard) SetPrefix(prefix *cid.Prefix) {
130 ds.prefix = prefix
131 }