(ids []string)
| 437 | } |
| 438 | |
| 439 | func NewBackupClientMap(ids []string) map[string]backupClientHelper { |
| 440 | var accounts []model.BackupAccount |
| 441 | var idItems []uint |
| 442 | for i := 0; i < len(ids); i++ { |
| 443 | item, _ := strconv.Atoi(ids[i]) |
| 444 | idItems = append(idItems, uint(item)) |
| 445 | } |
| 446 | accounts, _ = backupRepo.List(repo.WithByIDs(idItems)) |
| 447 | clientMap := make(map[string]backupClientHelper) |
| 448 | for _, item := range accounts { |
| 449 | backClient, err := newClient(&item, true) |
| 450 | itemHelper := backupClientHelper{ |
| 451 | client: backClient, |
| 452 | name: item.Name, |
| 453 | backupPath: item.BackupPath, |
| 454 | accountType: item.Type, |
| 455 | id: item.ID, |
| 456 | isOk: err == nil, |
| 457 | } |
| 458 | if err != nil { |
| 459 | itemHelper.message = err.Error() |
| 460 | } |
| 461 | clientMap[fmt.Sprintf("%v", item.ID)] = itemHelper |
| 462 | } |
| 463 | return clientMap |
| 464 | } |
| 465 | |
| 466 | func uploadWithMap(taskItem task.Task, accountMap map[string]backupClientHelper, src, dst, accountIDs string, downloadAccountID, retry uint) error { |
| 467 | accounts := strings.Split(accountIDs, ",") |
no test coverage detected