mirror of
https://github.com/restic/restic.git
synced 2026-11-10 08:41:00 +00:00
restic: change ListBlobs to return PackBlob
PackBlob is a limited interface that only exposes a part of the information provided by PackedBlob. Most of the changes are switches from direct value lookups to the interface methods, with a few larger changes to let the tests still work.
This commit is contained in:
1 parent
97f1e99ed9
commit
ccb5ae1592
15 files changed
+102
-73
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"github.com/restic/restic/internal/restic"
|
||||
)
|
||||
|
||||
// BlobsInPack returns index entries for blobs stored in packID, sorted by offset.
|
||||
func BlobsInPack(repo *Repository, packID restic.ID) restic.Blobs {
|
||||
var blobs restic.Blobs
|
||||
for pb := range repo.idx.Values() {
|
||||
if pb.PackID.Equal(packID) {
|
||||
blobs = append(blobs, pb.Blob)
|
||||
}
|
||||
}
|
||||
blobs.Sort()
|
||||
return blobs
|
||||
}
|
||||
Reference in new issue
Block a user