mirror of
https://github.com/octoleo/restic.git
synced 2024-12-27 12:42:49 +00:00
MemBackend: Add Delete() and more debug
This commit is contained in:
parent
26697a0223
commit
4f6bc754b8
@ -57,6 +57,14 @@ func NewMemoryBackend() *MemoryBackend {
|
||||
return memList(be, t, done)
|
||||
}
|
||||
|
||||
be.MockBackend.DeleteFn = func() error {
|
||||
be.m.Lock()
|
||||
defer be.m.Unlock()
|
||||
|
||||
be.data = make(memMap)
|
||||
return nil
|
||||
}
|
||||
|
||||
debug.Log("MemoryBackend.New", "created new memory backend")
|
||||
|
||||
return be
|
||||
@ -107,7 +115,7 @@ func (e *tempMemEntry) Finalize(t Type, name string) error {
|
||||
name = ""
|
||||
}
|
||||
|
||||
debug.Log("MemoryBackend", "save blob %p as %v %v", e, t, name)
|
||||
debug.Log("MemoryBackend", "save blob %p (%d bytes) as %v %v", e, len(e.data.Bytes()), t, name)
|
||||
return e.be.insert(t, name, e.data.Bytes())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user