1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 18:13:54 +08:00

Documentation.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
This commit is contained in:
Kevin Atkinson
2017-10-19 12:09:56 -04:00
parent 798afedf8d
commit 0182e5977c
4 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,10 @@ var v1CidPrefix = cid.Prefix{
Version: 1,
}
// V0CidPrefix returns a prefix for CIDv0
func V0CidPrefix() cid.Prefix { return v0CidPrefix }
// V1CidPrefix returns a prefix for CIDv1 with the default settings
func V1CidPrefix() cid.Prefix { return v1CidPrefix }
// PrefixForCidVersion returns the Protobuf prefix for a given CID version

View File

@ -131,7 +131,7 @@ func (ds *HamtShard) SetPrefix(prefix *cid.Prefix) {
ds.prefix = prefix
}
// GetPrefix gets the CID Prefix, may be nil if unset
// Prefix gets the CID Prefix, may be nil if unset
func (ds *HamtShard) Prefix() *cid.Prefix {
return ds.prefix
}

View File

@ -194,6 +194,7 @@ func (d *Directory) GetNode() (node.Node, error) {
return d.shard.Node()
}
// GetPrefix returns the CID Prefix used
func (d *Directory) GetPrefix() *cid.Prefix {
if d.shard == nil {
return &d.dirnode.Prefix

View File

@ -31,6 +31,7 @@ func GetDAGServ() mdag.DAGService {
return mdagmock.Mock()
}
// NodeOpts is used by GetNode, GetEmptyNode and GetRandomNode
type NodeOpts struct {
Prefix cid.Prefix
// ForceRawLeaves if true will force the use of raw leaves