mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:38:25 +00:00
move Backend interface to backend package
This commit is contained in:
@@ -178,7 +178,7 @@ func SearchKey(ctx context.Context, s *Repository, password string, maxKeys int,
|
||||
|
||||
// LoadKey loads a key from the backend.
|
||||
func LoadKey(ctx context.Context, s *Repository, id restic.ID) (k *Key, err error) {
|
||||
h := restic.Handle{Type: restic.KeyFile, Name: id.String()}
|
||||
h := backend.Handle{Type: restic.KeyFile, Name: id.String()}
|
||||
data, err := backend.LoadAll(ctx, nil, s.be, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -270,12 +270,12 @@ func AddKey(ctx context.Context, s *Repository, password, username, hostname str
|
||||
|
||||
id := restic.Hash(buf)
|
||||
// store in repository and return
|
||||
h := restic.Handle{
|
||||
h := backend.Handle{
|
||||
Type: restic.KeyFile,
|
||||
Name: id.String(),
|
||||
}
|
||||
|
||||
err = s.be.Save(ctx, h, restic.NewByteReader(buf, s.be.Hasher()))
|
||||
err = s.be.Save(ctx, h, backend.NewByteReader(buf, s.be.Hasher()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user