Documentation ¶
Overview ¶
Package traverse provides merkledag traversal functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrFunc ¶
ErrFunc is provided to handle problems when walking to the Node. 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 ipld.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.