2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-18 16:52:22 +00:00
restic/src/restic/readerat.go

20 lines
356 B
Go
Raw Normal View History

2016-08-31 20:39:36 +00:00
package restic
2016-08-25 19:49:00 +00:00
import (
"io"
)
type backendReaderAt struct {
be Backend
h Handle
}
func (brd backendReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
return brd.be.Load(brd.h, p, off)
}
// ReaderAt returns an io.ReaderAt for a file in the backend.
func ReaderAt(be Backend, h Handle) io.ReaderAt {
return backendReaderAt{be: be, h: h}
}