1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

break merkledag utils into its own package

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-07-24 12:45:33 -07:00
parent 194eb7c0dc
commit 7c510662ae
4 changed files with 243 additions and 114 deletions

View File

@ -153,6 +153,15 @@ func (n *Node) GetNodeLink(name string) (*Link, error) {
return nil, ErrNotFound
}
func (n *Node) GetLinkedNode(ctx context.Context, ds DAGService, name string) (*Node, error) {
lnk, err := n.GetNodeLink(name)
if err != nil {
return nil, err
}
return lnk.GetNode(ctx, ds)
}
// Copy returns a copy of the node.
// NOTE: does not make copies of Node objects in the links.
func (n *Node) Copy() *Node {