(fileOp fileUtils.FileOp, recordMap map[string][]string)
| 402 | return treeData |
| 403 | } |
| 404 | func loadUnknownDbs(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree { |
| 405 | dbs, _ := databaseRepo.GetList() |
| 406 | var excludePaths []string |
| 407 | dbMap := make(map[string]struct{}) |
| 408 | for _, db := range dbs { |
| 409 | dbMap[fmt.Sprintf("database/%s/%s", db.Type, db.Name)] = struct{}{} |
| 410 | } |
| 411 | for key, val := range recordMap { |
| 412 | itemName := path.Dir(key) |
| 413 | if _, ok := dbMap[itemName]; ok { |
| 414 | for _, item := range val { |
| 415 | excludePaths = append(excludePaths, path.Join(global.Dir.LocalBackupDir, key, item)) |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | backupPath := path.Join(global.Dir.LocalBackupDir, "database") |
| 420 | treeData := dto.CleanTree{ |
| 421 | ID: uuid.NewString(), |
| 422 | Label: "unknown_database", |
| 423 | Name: backupPath, |
| 424 | IsCheck: false, |
| 425 | IsRecommend: false, |
| 426 | CanDelete: false, |
| 427 | Type: "unknown_backup", |
| 428 | } |
| 429 | _ = loadFileOrDirWithExclude(fileOp, 0, backupPath, &treeData, excludePaths) |
| 430 | return treeData |
| 431 | } |
| 432 | func loadUnknownWebsites(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree { |
| 433 | websites, _ := websiteRepo.List() |
| 434 | var excludePaths []string |
no test coverage detected