mirror of
https://github.com/restic/restic.git
synced 2025-08-11 10:07:47 +00:00
backend: refactor backend Connections and HasAtomicReplace into Properties
This commit is contained in:
@@ -218,8 +218,11 @@ func (be *MemoryBackend) List(ctx context.Context, t backend.FileType, fn func(b
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
func (be *MemoryBackend) Connections() uint {
|
||||
return connectionCount
|
||||
func (be *MemoryBackend) Properties() backend.Properties {
|
||||
return backend.Properties{
|
||||
Connections: connectionCount,
|
||||
HasAtomicReplace: false,
|
||||
}
|
||||
}
|
||||
|
||||
// Hasher may return a hash function for calculating a content hash for the backend
|
||||
@@ -227,11 +230,6 @@ func (be *MemoryBackend) Hasher() hash.Hash {
|
||||
return xxhash.New()
|
||||
}
|
||||
|
||||
// HasAtomicReplace returns whether Save() can atomically replace files
|
||||
func (be *MemoryBackend) HasAtomicReplace() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Delete removes all data in the backend.
|
||||
func (be *MemoryBackend) Delete(ctx context.Context) error {
|
||||
be.m.Lock()
|
||||
|
Reference in New Issue
Block a user