refactor: Merge drive and reader config to enable implementations of tape management without synchronization

This commit is contained in:
Felix Pojtinger
2022-01-16 22:46:18 +01:00
parent 932a58d9d0
commit 5bb79b6d9e
28 changed files with 28 additions and 154 deletions
+6 -13
View File
@@ -7,8 +7,13 @@ import (
"time"
)
type ReadSeekFder interface {
io.ReadSeeker
Fd() uintptr
}
type DriveReaderConfig struct {
Drive io.ReadSeeker
Drive ReadSeekFder
DriveIsRegular bool
}
@@ -17,24 +22,12 @@ type DriveWriterConfig struct {
DriveIsRegular bool
}
type Drive interface {
Fd() uintptr
}
type DriveConfig struct {
Drive Drive
DriveIsRegular bool
}
type BackendConfig struct {
GetWriter func() (DriveWriterConfig, error)
CloseWriter func() error
GetReader func() (DriveReaderConfig, error)
CloseReader func() error
GetDrive func() (DriveConfig, error)
CloseDrive func() error
}
type Header struct {