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:
@@ -111,8 +111,11 @@ func (be *beSwift) createContainer(ctx context.Context, policy string) error {
|
||||
return be.conn.ContainerCreate(ctx, be.container, h)
|
||||
}
|
||||
|
||||
func (be *beSwift) Connections() uint {
|
||||
return be.connections
|
||||
func (be *beSwift) Properties() backend.Properties {
|
||||
return backend.Properties{
|
||||
Connections: be.connections,
|
||||
HasAtomicReplace: true,
|
||||
}
|
||||
}
|
||||
|
||||
// Hasher may return a hash function for calculating a content hash for the backend
|
||||
@@ -120,11 +123,6 @@ func (be *beSwift) Hasher() hash.Hash {
|
||||
return md5.New()
|
||||
}
|
||||
|
||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||
func (be *beSwift) HasAtomicReplace() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Load runs fn with a reader that yields the contents of the file at h at the
|
||||
// given offset.
|
||||
func (be *beSwift) Load(ctx context.Context, h backend.Handle, length int, offset int64, fn func(rd io.Reader) error) error {
|
||||
|
||||
Reference in New Issue
Block a user