GetSheetFull gets a sheet by SHA256 hash with the complete statement. Statement field contains the complete content regardless of size. Results are cached by SHA256 hex string.
(ctx context.Context, sha256Hex string)
| 40 | // Statement field contains the complete content regardless of size. |
| 41 | // Results are cached by SHA256 hex string. |
| 42 | func (s *Store) GetSheetFull(ctx context.Context, sha256Hex string) (*SheetMessage, error) { |
| 43 | if v, ok := s.sheetFullCache.Get(sha256Hex); ok && s.enableCache { |
| 44 | return v, nil |
| 45 | } |
| 46 | |
| 47 | sheet, err := s.getSheet(ctx, sha256Hex, true) |
| 48 | if err != nil { |
| 49 | return nil, err |
| 50 | } |
| 51 | if sheet == nil { |
| 52 | return nil, nil |
| 53 | } |
| 54 | |
| 55 | s.sheetFullCache.Add(sha256Hex, sheet) |
| 56 | return sheet, nil |
| 57 | } |
| 58 | |
| 59 | // getSheet is the internal helper for fetching a single sheet by SHA256. |
| 60 | func (s *Store) getSheet(ctx context.Context, sha256Hex string, loadFull bool) (*SheetMessage, error) { |
no test coverage detected