refactor: Normalize internal and pkg packages

This commit is contained in:
Felicitas Pojtinger
2021-12-08 21:44:57 +01:00
parent 6c5c932b2d
commit f6b1ab0320
36 changed files with 258 additions and 219 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"filippo.io/age"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/pojntfx/stfs/internal/pax"
"github.com/pojntfx/stfs/internal/records"
"github.com/pojntfx/stfs/pkg/config"
)
@@ -63,7 +63,7 @@ func DecryptHeader(
return config.ErrEmbeddedHeaderMissing
}
encryptedEmbeddedHeader, ok := hdr.PAXRecords[pax.STFSRecordEmbeddedHeader]
encryptedEmbeddedHeader, ok := hdr.PAXRecords[records.STFSRecordEmbeddedHeader]
if !ok {
return config.ErrEmbeddedHeaderMissing
}
+4 -4
View File
@@ -9,8 +9,8 @@ import (
"filippo.io/age"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/pojntfx/stfs/internal/noop"
"github.com/pojntfx/stfs/internal/pax"
"github.com/pojntfx/stfs/internal/ioext"
"github.com/pojntfx/stfs/internal/records"
"github.com/pojntfx/stfs/pkg/config"
)
@@ -35,7 +35,7 @@ func Encrypt(
return openpgp.Encrypt(dst, recipient, nil, nil, nil)
case config.NoneKey:
return noop.AddClose(dst), nil
return ioext.AddClose(dst), nil
default:
return nil, config.ErrEncryptionFormatUnsupported
}
@@ -61,7 +61,7 @@ func EncryptHeader(
return err
}
newHdr.PAXRecords[pax.STFSRecordEmbeddedHeader], err = EncryptString(string(wrappedHeader), encryptionFormat, recipient)
newHdr.PAXRecords[records.STFSRecordEmbeddedHeader], err = EncryptString(string(wrappedHeader), encryptionFormat, recipient)
if err != nil {
return err
}