refactor: Inject mtio package to allow for remote implementation

This commit is contained in:
Felicitas Pojtinger
2022-01-16 23:50:47 +01:00
parent 5b84583403
commit 5d3424df92
36 changed files with 183 additions and 100 deletions

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
}

View File

@@ -34,6 +34,8 @@ const (
WriteCacheTypeMemory = "memory"
WriteCacheTypeFile = "file"
MagneticTapeBlockSize = 512
)
var (