summaryrefslogtreecommitdiff
path: root/internal/store/store.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-07 15:41:44 +0200
committerPaul Buetow <paul@buetow.org>2026-03-07 15:41:44 +0200
commitfcbe17d60b7bf71e32a288db18d95e7f0948c2db (patch)
tree4443021dbb1a53c983d8ab0296734602a12391f4 /internal/store/store.go
parente353f20ac9ac8da0bc0cbcd7bb22838f765f47bc (diff)
Add KeePass migration command with text/password and binary attachment supportHEADmaster
Diffstat (limited to 'internal/store/store.go')
-rw-r--r--internal/store/store.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/store/store.go b/internal/store/store.go
index 527ece8..c91798f 100644
--- a/internal/store/store.go
+++ b/internal/store/store.go
@@ -149,6 +149,14 @@ func (s *Store) processIndexFile(ctx context.Context, path, searchTerm string, r
return nil
}
+// LoadData decrypts and returns the .data payload for the given index entry.
+func (s *Store) LoadData(ctx context.Context, idx *Index) (*Data, error) {
+ if idx == nil {
+ return nil, fmt.Errorf("loading data: nil index")
+ }
+ return loadData(ctx, filepath.Join(s.cfg.DataDir, idx.DataFile), s.cipher, s.git)
+}
+
// Search collects all indexes matching searchTerm, sorts them by Description,
// and applies the given action to each. For ActionCat the decrypted content is
// printed; for ActionExport/ActionPathExport the content is written to ExportDir.