diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-07 15:41:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-07 15:41:44 +0200 |
| commit | fcbe17d60b7bf71e32a288db18d95e7f0948c2db (patch) | |
| tree | 4443021dbb1a53c983d8ab0296734602a12391f4 /internal/store | |
| parent | e353f20ac9ac8da0bc0cbcd7bb22838f765f47bc (diff) | |
Diffstat (limited to 'internal/store')
| -rw-r--r-- | internal/store/store.go | 8 |
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. |
