mirror of
https://github.com/octoleo/restic.git
synced 2024-11-04 20:37:49 +00:00
mem backend: remove unused code
This commit is contained in:
parent
3d06e6083a
commit
322eca86bc
@ -1,7 +1,6 @@
|
||||
package mem
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"sync"
|
||||
@ -98,30 +97,6 @@ func memTest(be *MemoryBackend, t backend.Type, name string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// tempMemEntry temporarily holds data written to the memory backend before it
|
||||
// is finalized.
|
||||
type tempMemEntry struct {
|
||||
be *MemoryBackend
|
||||
data bytes.Buffer
|
||||
}
|
||||
|
||||
func (e *tempMemEntry) Write(p []byte) (int, error) {
|
||||
return e.data.Write(p)
|
||||
}
|
||||
|
||||
func (e *tempMemEntry) Size() uint {
|
||||
return uint(len(e.data.Bytes()))
|
||||
}
|
||||
|
||||
func (e *tempMemEntry) Finalize(t backend.Type, name string) error {
|
||||
if t == backend.Config {
|
||||
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())
|
||||
}
|
||||
|
||||
func memLoad(be *MemoryBackend, h backend.Handle, p []byte, off int64) (int, error) {
|
||||
if err := h.Valid(); err != nil {
|
||||
return 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user