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

Function NewBackupClientMap

agent/app/service/backup.go:439–464  ·  view source on GitHub ↗
(ids []string)

Source from the content-addressed store, hash-verified

437}
438
439func 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
466func uploadWithMap(taskItem task.Task, accountMap map[string]backupClientHelper, src, dst, accountIDs string, downloadAccountID, retry uint) error {
467 accounts := strings.Split(accountIDs, ",")

Callers 11

LoadRecordSizeMethod · 0.85
handleAppMethod · 0.85
handleWebsiteMethod · 0.85
handleDatabaseMethod · 0.85
handleDirectoryMethod · 0.85
handleSystemLogMethod · 0.85
handleSnapshotMethod · 0.85
CleanRecordMethod · 0.85
handleCutWebsiteLogMethod · 0.85
DeleteMethod · 0.85
snapUploadFunction · 0.85

Calls 3

newClientFunction · 0.85
ListMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected