Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
  • Loading branch information
kevina committed Apr 26, 2017
1 parent 8a47786 commit 9350c51
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions importer/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion merkledag/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions mfs/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions unixfs/hamt/hamt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9350c51

Please sign in to comment.