packagetraversalimport("context"cid"github.com/ipfs/go-cid"ipld"github.com/ipld/go-ipld-prime")// VisitFn is a read-only visitor.typeVisitFnfunc(TraversalProgress,ipld.Node)error// TransformFn is like a visitor that can also return a new Node to replace the visited one.typeTransformFnfunc(TraversalProgress,ipld.Node)(ipld.Node,error)// AdvVisitFn is like VisitFn, but for use with AdvTraversal: it gets additional arguments describing *why* this node is visited.typeAdvVisitFnfunc(TraversalProgress,ipld.Node,TraversalReason)(ipld.Node,error)// TraversalReason provides additional information to traversals using AdvVisitFn.typeTraversalReasonbyte// enum = SelectionMatch | SelectionParent | SelectionCandidate // probably only pointful for block edges?typeTraversalProgressstruct{*TraversalConfigPathPath// Path is how we reached the current point in the traversal.LastBlockstruct{// LastBlock stores the Path and CID of the last block edge we had to load. (It will always be zero in traversals with no linkloader.)Pathcid.Cid}}typeTraversalConfigstruct{Ctxcontext.Context// Context carried through a traversal. Optional; use it if you need cancellation.}