Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing custom NavigableNode implementations #58

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about naming as IPLDNode or even just Node?


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

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