mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
25 lines
515 B
Go
25 lines
515 B
Go
package objecttree
|
|
|
|
type objectTreeDebug struct {
|
|
}
|
|
|
|
type DebugInfo struct {
|
|
TreeLen int
|
|
TreeString string
|
|
Graphviz string
|
|
Heads []string
|
|
SnapshotPath []string
|
|
}
|
|
|
|
func (o objectTreeDebug) debugInfo(ot *objectTree, parser DescriptionParser) (di DebugInfo, err error) {
|
|
di = DebugInfo{}
|
|
di.Graphviz, err = ot.tree.Graph(parser)
|
|
if err != nil {
|
|
return
|
|
}
|
|
di.TreeString = ot.tree.String()
|
|
di.TreeLen = ot.tree.Len()
|
|
di.Heads = ot.Heads()
|
|
di.SnapshotPath, _ = ot.SnapshotPath()
|
|
return
|
|
}
|