summaryrefslogtreecommitdiff
path: root/internal/store/store.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 10:52:39 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 10:52:39 +0200
commit1bd6d282d2352870e68654afca3fa4a4ea7195ea (patch)
tree8159f9a453a4b4a61dd5fd45ac442623b6906ea5 /internal/store/store.go
parent858b51ff554b823c9cf943723db48224ef130d99 (diff)
store: decouple crypto/git via interfaces (task 402)
Diffstat (limited to 'internal/store/store.go')
-rw-r--r--internal/store/store.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/store/store.go b/internal/store/store.go
index 44b22c3..9acb52d 100644
--- a/internal/store/store.go
+++ b/internal/store/store.go
@@ -21,8 +21,6 @@ import (
"strings"
"codeberg.org/snonux/foostore/internal/config"
- "codeberg.org/snonux/foostore/internal/crypto"
- "codeberg.org/snonux/foostore/internal/git"
)
// Action describes what to do with each matching secret during a Search call.
@@ -60,13 +58,13 @@ type PickerResult struct {
// regexCache avoids recompiling the same search-term regexp on every WalkIndexes call.
type Store struct {
cfg *config.Config
- cipher *crypto.Cipher
- git *git.Git
+ cipher Encryptor
+ git Committer
regexCache map[string]*regexp.Regexp
}
// New creates a Store, ensuring cfg.DataDir exists on disk.
-func New(cfg *config.Config, cipher *crypto.Cipher, g *git.Git) (*Store, error) {
+func New(cfg *config.Config, cipher Encryptor, g Committer) (*Store, error) {
if err := os.MkdirAll(cfg.DataDir, 0o700); err != nil {
return nil, fmt.Errorf("creating data directory %q: %w", cfg.DataDir, err)
}