Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBreak = errors.New("BREAK")
ErrBreak will terminate visit execution returning a nil error.
View Source
var ErrContinue = errors.New("CONTINUE")
ErrContinue will skip the node and its children.
Functions ¶
func Visit ¶
func Visit( ctx context.Context, blk block.Block, bcs *block.Cursor, cb Visitor, existingOnly bool, ) error
Visit will walk through a block tree using a depth-first traversal. The callback is called with each block in the tree.
If existingOnly, only returns references that have already been traversed. If !existingOnly uses GetSubBlocks and/or GetBlockRefs to list all references.
Types ¶
type Location ¶
type Location struct {
// Depth is the depth of this position.
Depth int
// Parent contains the parent location.
Parent *Location
// Cursor contains the block graph cursor at the location.
Cursor *block.Cursor
// Block contains the block or sub-block at the location.
// May be nil if the block type is unknown or ref not found.
Block any
// ParentRefID is the reference ID that was previously followed.
ParentRefID uint32
}
Location is a position in the visitor graph
func (*Location) GetParentBlocks ¶
GetParentBlocks traverses the list and gets all parent blocks The tail block is the first in the list.
Click to show internal directories.
Click to hide internal directories.