repository: move Blob, Blobs and PackedBlob to pack package

This removes them from the public interface. The latter now only
provides the PackBlob interface, without being bound to the type used
internally by the pack package.
This commit is contained in:
Michael Eischer
2026-06-04 22:21:53 +02:00
parent 35af104749
commit c062a78dcd
27 changed files with 373 additions and 345 deletions
+3 -3
View File
@@ -123,7 +123,7 @@ func ExaminePack(ctx context.Context, repo *Repository, id restic.ID, opts Exami
checkPackSize(b.Blobs, len(buf), printer)
err = loadBlobs(ctx, opts, repo, id, b.Blobs, printer)
err := loadBlobs(ctx, opts, repo, id, b.Blobs, printer)
if err != nil {
printer.E("error: %v", err)
} else {
@@ -146,7 +146,7 @@ func ExaminePack(ctx context.Context, repo *Repository, id restic.ID, opts Exami
return nil
}
func checkPackSize(blobs restic.Blobs, fileSize int, printer progress.Printer) {
func checkPackSize(blobs pack.Blobs, fileSize int, printer progress.Printer) {
// track current size and offset
var size, offset uint64
@@ -284,7 +284,7 @@ func decryptUnsigned(k *crypto.Key, buf []byte) []byte {
return out
}
func loadBlobs(ctx context.Context, opts ExaminePackOptions, repo *Repository, packID restic.ID, list restic.Blobs, printer progress.Printer) error {
func loadBlobs(ctx context.Context, opts ExaminePackOptions, repo *Repository, packID restic.ID, list pack.Blobs, printer progress.Printer) error {
dec, err := zstd.NewReader(nil)
if err != nil {
panic(err)