refactor: Merge drive and reader config to enable implementations of tape management without synchronization
This commit is contained in:
+6
-13
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user