mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
backend: refactor backend Connections and HasAtomicReplace into Properties
This commit is contained in:
@@ -154,8 +154,11 @@ func (be *b2Backend) SetListMaxItems(i int) {
|
||||
be.listMaxItems = i
|
||||
}
|
||||
|
||||
func (be *b2Backend) Connections() uint {
|
||||
return be.cfg.Connections
|
||||
func (be *b2Backend) Properties() backend.Properties {
|
||||
return backend.Properties{
|
||||
Connections: be.cfg.Connections,
|
||||
HasAtomicReplace: true,
|
||||
}
|
||||
}
|
||||
|
||||
// Hasher may return a hash function for calculating a content hash for the backend
|
||||
@@ -163,11 +166,6 @@ func (be *b2Backend) Hasher() hash.Hash {
|
||||
return nil
|
||||
}
|
||||
|
||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||
func (be *b2Backend) HasAtomicReplace() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsNotExist returns true if the error is caused by a non-existing file.
|
||||
func (be *b2Backend) IsNotExist(err error) bool {
|
||||
// blazer/b2 does not export its error types and values,
|
||||
|
||||
Reference in New Issue
Block a user