MCPcopy Create free account
hub / github.com/pydio/cells / GetNodeTree

Method GetNodeTree

common/storage/sql/index/folder-size-cache.go:133–159  ·  view source on GitHub ↗

GetNodeTree List from the path

(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter)

Source from the content-addressed store, hash-verified

131
132// GetNodeTree List from the path
133func (dao *FolderSizeCacheSQL) GetNodeTree(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter) chan interface{} {
134 c := make(chan interface{})
135
136 go func() {
137 defer close(c)
138
139 cc := dao.DAO.GetNodeTree(ctx, path, filter...)
140
141 for obj := range cc {
142 if node, ok := obj.(*tree.TreeNode); ok {
143 if node != nil && !node.GetNode().IsLeaf() {
144 err := dao.folderSize(ctx, node)
145 if err != nil {
146 log.Logger(ctx).Debug("Unable to use cache for folder size", zap.Error(err))
147 }
148 }
149 }
150 select {
151 case c <- obj:
152 case <-ctx.Done():
153 return
154 }
155 }
156 }()
157
158 return c
159}
160
161func (dao *FolderSizeCacheSQL) GetOrCreateNodeByPath(ctx context.Context, nodePath string, info *tree.Node, rootInfo ...*tree.Node) (tree.ITreeNode, []tree.ITreeNode, error) {
162 n, cc, e := dao.DAO.GetOrCreateNodeByPath(ctx, nodePath, info, rootInfo...)

Callers

nothing calls this directly

Calls 10

folderSizeMethod · 0.95
LoggerFunction · 0.92
makeFunction · 0.85
GetNodeTreeMethod · 0.65
IsLeafMethod · 0.65
GetNodeMethod · 0.65
DebugMethod · 0.65
ErrorMethod · 0.65
DoneMethod · 0.65
closeFunction · 0.50

Tested by

no test coverage detected