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

Function loadChildren

tui/tree.go:246–267  ·  view source on GitHub ↗

Loads child nodes and their attributes directly from LDAP

(node *tview.TreeNode)

Source from the content-addressed store, hash-verified

244
245// Loads child nodes and their attributes directly from LDAP
246func loadChildren(node *tview.TreeNode) bool {
247 baseDN := node.GetReference().(string)
248 entries, err := lc.QueryWithAttrs(baseDN, SearchFilter, ldap.ScopeSingleLevel, Deleted, parseAttrsList(explorerAttrsList))
249 if err != nil {
250 handleLDAPError(err)
251 return false
252 }
253
254 // Sort results to guarantee stable view
255 sort.Slice(entries, func(i int, j int) bool {
256 return getName(entries[i]) < getName(entries[j])
257 })
258
259 for _, entry := range entries {
260 childNode := createTreeNodeFromEntry(entry)
261
262 if childNode != nil {
263 node.AddChild(childNode)
264 }
265 }
266 return true
267}
268
269func handleAttrsKeyCtrlE(currentNode *tview.TreeNode, attrsPanel *tview.Table, cache *EntryCache) {
270 currentFocus := app.GetFocus()

Callers 3

expandTreeNodeFunction · 0.85
reloadParentNodeFunction · 0.85
treePanelKeyHandlerFunction · 0.85

Calls 5

parseAttrsListFunction · 0.85
handleLDAPErrorFunction · 0.85
getNameFunction · 0.85
createTreeNodeFromEntryFunction · 0.85
QueryWithAttrsMethod · 0.80

Tested by

no test coverage detected