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:
@@ -264,8 +264,11 @@ func Create(ctx context.Context, cfg Config) (*SFTP, error) {
|
||||
return open(sftp, cfg)
|
||||
}
|
||||
|
||||
func (r *SFTP) Connections() uint {
|
||||
return r.Config.Connections
|
||||
func (r *SFTP) Properties() backend.Properties {
|
||||
return backend.Properties{
|
||||
Connections: r.Config.Connections,
|
||||
HasAtomicReplace: r.posixRename,
|
||||
}
|
||||
}
|
||||
|
||||
// Hasher may return a hash function for calculating a content hash for the backend
|
||||
@@ -273,11 +276,6 @@ func (r *SFTP) Hasher() hash.Hash {
|
||||
return nil
|
||||
}
|
||||
|
||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||
func (r *SFTP) HasAtomicReplace() bool {
|
||||
return r.posixRename
|
||||
}
|
||||
|
||||
// tempSuffix generates a random string suffix that should be sufficiently long
|
||||
// to avoid accidental conflicts
|
||||
func tempSuffix() string {
|
||||
|
||||
Reference in New Issue
Block a user