Skip to content

Commit

Permalink
Merge pull request #58 from Wondertan/master
Browse files Browse the repository at this point in the history
Allowing custom NavigableNode implementations
  • Loading branch information
Stebalien authored Jun 10, 2020
2 parents ea9b662 + 95595c1 commit d2e0942
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion navipld.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (nn *NavigableIPLDNode) ChildTotal() uint {
// function.
// TODO: Check for errors to avoid a panic?
func ExtractIPLDNode(node NavigableNode) Node {
return node.(*NavigableIPLDNode).GetIPLDNode()
return node.GetIPLDNode()
}

// TODO: `Cleanup` is not supported at the moment in the `Walker`.
Expand Down
3 changes: 3 additions & 0 deletions walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ type NavigableNode interface {
// ChildTotal returns the number of children of the `ActiveNode`.
ChildTotal() uint

// GetIPLDNode returns actual IPLD Node
GetIPLDNode() Node

// TODO: Evaluate providing the `Cleanup` and `Reset` methods.

// Cleanup is an optional method that is called by the `Walker` when
Expand Down

0 comments on commit d2e0942

Please sign in to comment.