MCPcopy Create free account
hub / github.com/Macmod/godap / createTreeNodeFromEntry

Function createTreeNodeFromEntry

tui/tree.go:201–226  ·  view source on GitHub ↗
(entry *ldap.Entry)

Source from the content-addressed store, hash-verified

199}
200
201func createTreeNodeFromEntry(entry *ldap.Entry) *tview.TreeNode {
202 _, ok := explorerCache.Get(entry.DN)
203
204 if !ok {
205 nodeName := getNodeName(entry)
206
207 node := tview.NewTreeNode(nodeName).
208 SetReference(entry.DN).
209 SetSelectable(true)
210
211 // Helpful node coloring for deleted and disabled objects
212 if Colors {
213 color, changed := GetEntryColor(entry)
214 if changed {
215 node.SetColor(color)
216 }
217 }
218
219 explorerCache.Add(entry.DN, entry)
220
221 node.SetExpanded(false)
222 return node
223 } else {
224 return nil
225 }
226}
227
228// Unloads child nodes and their attributes from the cache
229func unloadChildren(parentNode *tview.TreeNode) {

Callers 2

loadChildrenFunction · 0.85
renderPartialTreeFunction · 0.85

Calls 4

getNodeNameFunction · 0.85
GetEntryColorFunction · 0.85
GetMethod · 0.80
AddMethod · 0.80

Tested by

no test coverage detected