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:
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user