MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadTreeWithCheck

Function loadTreeWithCheck

agent/app/service/device_clean.go:817–825  ·  view source on GitHub ↗
(treeData []dto.CleanTree, pathItem, treeType string, fileOp fileUtils.FileOp)

Source from the content-addressed store, hash-verified

815}
816
817func loadTreeWithCheck(treeData []dto.CleanTree, pathItem, treeType string, fileOp fileUtils.FileOp) []dto.CleanTree {
818 size, _ := fileOp.GetDirSize(pathItem)
819 if size == 0 {
820 return treeData
821 }
822 list := loadTreeWithAllFile(true, pathItem, treeType, pathItem, fileOp)
823 treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: treeType, Size: uint64(size), IsCheck: size > 0, Children: list, Type: treeType, IsRecommend: true, CanDelete: false})
824 return treeData
825}
826
827func loadTreeWithDir(isCheck bool, treeType, pathItem string, fileOp fileUtils.FileOp) []dto.CleanTree {
828 var lists []dto.CleanTree

Callers 3

loadRollBackTreeFunction · 0.85
loadUploadTreeFunction · 0.85
loadDownloadTreeFunction · 0.85

Calls 2

loadTreeWithAllFileFunction · 0.85
GetDirSizeMethod · 0.80

Tested by

no test coverage detected