Documentation ¶
Overview ¶
Package traverse provides merkledag traversal functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrFunc ¶
If there is a problem walking to the Node, and ErrFunc is provided, Traverse will call ErrFunc with the error encountered. ErrFunc can decide how to handle that error, and return an error back to Traversal with how to proceed:
- nil - skip the Node and its children, but continue processing
- all other errors halt processing immediately.
If ErrFunc is nil, Traversal will stop, as if:
opts.ErrFunc = func(err error) { return err }
type Func ¶
Func is the type of the function called for each dag.Node visited by Traverse. The traversal argument contains the current traversal state. If an error is returned, processing stops.
type Options ¶
type Options struct { DAG node.NodeGetter // the dagservice to fetch nodes Order Order // what order to traverse in Func Func // the function to perform at each step ErrFunc ErrFunc // see ErrFunc. Optional SkipDuplicates bool // whether to skip duplicate nodes }
Options specifies a series of traversal options
Click to show internal directories.
Click to hide internal directories.