Take the new base finder code, wrap it in a thin wrapper and use it in place of the previous way of finding base snapshots This solution is not focused on efficiency as it does result in looking up backup models multiple times. It's more to get the new way of finding bases out and then we can go back and smooth things over when we have the chance --- #### Does this PR need a docs update or release note? - [x] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change - [x] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) * #3202 #### Test Plan - [ ] 💪 Manual - [x] ⚡ Unit test - [x] 💚 E2E
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package inject
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/alcionai/corso/src/internal/common/prefixmatcher"
|
|
"github.com/alcionai/corso/src/internal/data"
|
|
"github.com/alcionai/corso/src/internal/kopia"
|
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
|
"github.com/alcionai/corso/src/pkg/fault"
|
|
"github.com/alcionai/corso/src/pkg/path"
|
|
)
|
|
|
|
type (
|
|
BackupConsumer interface {
|
|
ConsumeBackupCollections(
|
|
ctx context.Context,
|
|
bases []kopia.IncrementalBase,
|
|
cs []data.BackupCollection,
|
|
pmr prefixmatcher.StringSetReader,
|
|
tags map[string]string,
|
|
buildTreeWithBase bool,
|
|
errs *fault.Bus,
|
|
) (*kopia.BackupStats, *details.Builder, kopia.DetailsMergeInfoer, error)
|
|
}
|
|
|
|
RestoreProducer interface {
|
|
ProduceRestoreCollections(
|
|
ctx context.Context,
|
|
snapshotID string,
|
|
paths []path.RestorePaths,
|
|
bc kopia.ByteCounter,
|
|
errs *fault.Bus,
|
|
) ([]data.RestoreCollection, error)
|
|
}
|
|
|
|
BaseFinder interface {
|
|
FindBases(
|
|
ctx context.Context,
|
|
reasons []kopia.Reason,
|
|
tags map[string]string,
|
|
) ([]kopia.ManifestEntry, error)
|
|
}
|
|
)
|