mirror of
https://github.com/restic/restic.git
synced 2026-09-29 15:30:29 +00:00
restic: decouple restic.Handle
This commit is contained in:
@@ -163,7 +163,7 @@ func (r *Repository) savePacker(ctx context.Context, t restic.BlobType, p *Packe
|
||||
}
|
||||
|
||||
id := restic.IDFromHash(hr.Sum(nil))
|
||||
h := restic.Handle{Type: restic.PackFile, Name: id.String(), ContainedBlobType: t}
|
||||
h := restic.Handle{Type: restic.PackFile, Name: id.String(), IsMetadata: t.IsMetadata()}
|
||||
var beHash []byte
|
||||
if beHr != nil {
|
||||
beHash = beHr.Sum(nil)
|
||||
|
||||
@@ -284,7 +284,7 @@ func (r *Repository) LoadBlob(ctx context.Context, t restic.BlobType, id restic.
|
||||
}
|
||||
|
||||
// load blob from pack
|
||||
h := restic.Handle{Type: restic.PackFile, Name: blob.PackID.String(), ContainedBlobType: t}
|
||||
h := restic.Handle{Type: restic.PackFile, Name: blob.PackID.String(), IsMetadata: t.IsMetadata()}
|
||||
|
||||
switch {
|
||||
case cap(buf) < int(blob.Length):
|
||||
@@ -922,7 +922,7 @@ func StreamPack(ctx context.Context, beLoad BackendLoadFn, key *crypto.Key, pack
|
||||
}
|
||||
|
||||
func streamPackPart(ctx context.Context, beLoad BackendLoadFn, key *crypto.Key, packID restic.ID, blobs []restic.Blob, handleBlobFn func(blob restic.BlobHandle, buf []byte, err error) error) error {
|
||||
h := restic.Handle{Type: restic.PackFile, Name: packID.String(), ContainedBlobType: restic.DataBlob}
|
||||
h := restic.Handle{Type: restic.PackFile, Name: packID.String(), IsMetadata: false}
|
||||
|
||||
dataStart := blobs[0].Offset
|
||||
dataEnd := blobs[len(blobs)-1].Offset + blobs[len(blobs)-1].Length
|
||||
|
||||
Reference in New Issue
Block a user