MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / findNode

Method findNode

internal/ui/components/storage_browser.go:567–581  ·  view source on GitHub ↗
(root *tview.TreeNode, key string)

Source from the content-addressed store, hash-verified

565}
566
567func (sb *StorageBrowser) findNode(root *tview.TreeNode, key string) *tview.TreeNode {
568 if root == nil || key == "" {
569 return nil
570 }
571 var found *tview.TreeNode
572 root.Walk(func(node, parent *tview.TreeNode) bool {
573 ref, _ := node.GetReference().(*storageSelection)
574 if ref != nil && selectionKey(ref.Node, ref.Storage) == key {
575 found = node
576 return false
577 }
578 return true
579 })
580 return found
581}
582
583func (sb *StorageBrowser) jumpTreeTop() {
584 if root := sb.tree.GetRoot(); root != nil {

Callers 2

SelectNodeMethod · 0.95
restoreSelectionMethod · 0.95

Calls 1

selectionKeyFunction · 0.85

Tested by

no test coverage detected