mirror of
https://github.com/restic/restic.git
synced 2026-06-01 14:49:44 +00:00
index: replace custom EachByPackResult datatype
This commit is contained in:
@@ -228,11 +228,6 @@ func (idx *Index) Values() iter.Seq[restic.PackedBlob] {
|
||||
}
|
||||
}
|
||||
|
||||
type EachByPackResult struct {
|
||||
PackID restic.ID
|
||||
Blobs restic.Blobs
|
||||
}
|
||||
|
||||
// EachByPack returns a channel that yields all blobs known to the index
|
||||
// grouped by packID but ignoring blobs with a packID in packPlacklist for
|
||||
// finalized indexes.
|
||||
@@ -240,10 +235,10 @@ type EachByPackResult struct {
|
||||
// from the finalized index which have been re-read into a non-finalized index.
|
||||
// When the context is cancelled, the background goroutine
|
||||
// terminates. This blocks any modification of the index.
|
||||
func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-chan EachByPackResult {
|
||||
func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-chan restic.PackBlobs {
|
||||
idx.m.RLock()
|
||||
|
||||
ch := make(chan EachByPackResult)
|
||||
ch := make(chan restic.PackBlobs)
|
||||
|
||||
go func() {
|
||||
defer idx.m.RUnlock()
|
||||
@@ -264,7 +259,7 @@ func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-
|
||||
}
|
||||
|
||||
for packID, packByType := range byPack {
|
||||
var result EachByPackResult
|
||||
var result restic.PackBlobs
|
||||
result.PackID = packID
|
||||
for typ, p := range packByType {
|
||||
for _, e := range p {
|
||||
|
||||
Reference in New Issue
Block a user