refactor: Inject mtio package to allow for remote implementation

This commit is contained in:
Felix Pojtinger
2022-01-16 23:50:47 +01:00
parent 5bb79b6d9e
commit 25cacd34d8
36 changed files with 183 additions and 100 deletions

View File

@@ -241,6 +241,7 @@ func (f *STFS) Initialize(rootProposal string, rootPerm os.FileMode) (root strin
if err := recovery.Index(
reader,
f.readOps.GetBackend().MagneticTapeIO,
f.readOps.GetMetadata(),
f.readOps.GetPipes(),
f.readOps.GetCrypto(),

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,