ResolveExcerpt retrieve an Excerpt matching the exact given id
(id entity.Id)
| 394 | |
| 395 | // ResolveExcerpt retrieve an Excerpt matching the exact given id |
| 396 | func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerpt(id entity.Id) (ExcerptT, error) { |
| 397 | sc.mu.RLock() |
| 398 | defer sc.mu.RUnlock() |
| 399 | |
| 400 | excerpt, ok := sc.excerpts[id] |
| 401 | if !ok { |
| 402 | return *new(ExcerptT), entity.NewErrNotFound(sc.typename) |
| 403 | } |
| 404 | |
| 405 | return excerpt, nil |
| 406 | } |
| 407 | |
| 408 | // ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple |
| 409 | // entities match. |