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:
@@ -261,8 +261,11 @@ func (be *Backend) IsPermanentError(err error) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (be *Backend) Connections() uint {
|
||||
return be.cfg.Connections
|
||||
func (be *Backend) 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
|
||||
@@ -270,11 +273,6 @@ func (be *Backend) Hasher() hash.Hash {
|
||||
return nil
|
||||
}
|
||||
|
||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||
func (be *Backend) HasAtomicReplace() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Path returns the path in the bucket that is used for this backend.
|
||||
func (be *Backend) Path() string {
|
||||
return be.cfg.Prefix
|
||||
|
||||
Reference in New Issue
Block a user