Looks up a revision from the cache only. Will not fall back to loader function if not present in the cache.
(ctx context.Context, docID, revID string, collectionID uint32)
| 171 | // Looks up a revision from the cache only. Will not fall back to loader function if not |
| 172 | // present in the cache. |
| 173 | func (rc *LRURevisionCache) Peek(ctx context.Context, docID, revID string, collectionID uint32) (docRev DocumentRevision, found bool) { |
| 174 | docRev, err := rc.getFromCacheByRev(ctx, docID, revID, collectionID, false, RevCacheOmitDelta) |
| 175 | if err != nil { |
| 176 | return DocumentRevision{}, false |
| 177 | } |
| 178 | return docRev, docRev.BodyBytes != nil |
| 179 | } |
| 180 | |
| 181 | // Attempt to update the delta on a revision cache entry. If the entry is no longer resident in the cache, |
| 182 | // fails silently |