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

@@ -21,6 +21,7 @@ import (
"github.com/pojntfx/stfs/pkg/cache"
"github.com/pojntfx/stfs/pkg/config"
"github.com/pojntfx/stfs/pkg/keys"
"github.com/pojntfx/stfs/pkg/mtio"
"github.com/pojntfx/stfs/pkg/operations"
"github.com/pojntfx/stfs/pkg/persisters"
"github.com/pojntfx/stfs/pkg/tape"
@@ -339,8 +340,10 @@ func createSTFS(
initialize bool,
) (afero.Fs, error) {
mt := mtio.MagneticTapeIO{}
tm := tape.NewTapeManager(
drive,
mt,
recordSize,
false,
)
@@ -369,6 +372,8 @@ func createSTFS(
GetReader: tm.GetReader,
CloseReader: tm.Close,
MagneticTapeIO: mt,
}
readCryptoConfig := config.CryptoConfig{
Recipient: signatureRecipient,