refactor: Inject mtio package to allow for remote implementation
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ const (
|
||||
|
||||
WriteCacheTypeMemory = "memory"
|
||||
WriteCacheTypeFile = "file"
|
||||
|
||||
MagneticTapeBlockSize = 512
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user