refactor: Inject mtio package to allow for remote implementation

This commit is contained in:
Felix Pojtinger
2022-01-16 23:50:47 +01:00
parent 5bb79b6d9e
commit 25cacd34d8
36 changed files with 183 additions and 100 deletions
+10
View File
@@ -28,6 +28,8 @@ type BackendConfig struct {
GetReader func() (DriveReaderConfig, error)
CloseReader func() error
MagneticTapeIO MagneticTapeIO
}
type Header struct {
@@ -96,3 +98,11 @@ type FileConfig struct {
Path string
Link string
}
type MagneticTapeIO interface {
GetCurrentRecordFromTape(fd uintptr) (int64, error)
GoToEndOfTape(fd uintptr) error
GoToNextFileOnTape(fd uintptr) error
EjectTape(fd uintptr) error
SeekToRecordOnTape(fd uintptr, record int32) error
}
+2
View File
@@ -34,6 +34,8 @@ const (
WriteCacheTypeMemory = "memory"
WriteCacheTypeFile = "file"
MagneticTapeBlockSize = 512
)
var (