ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple entities match.
(prefix string)
| 408 | // ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple |
| 409 | // entities match. |
| 410 | func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerptPrefix(prefix string) (ExcerptT, error) { |
| 411 | return sc.ResolveExcerptMatcher(func(excerpt ExcerptT) bool { |
| 412 | return excerpt.Id().HasPrefix(prefix) |
| 413 | }) |
| 414 | } |
| 415 | |
| 416 | func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerptMatcher(f func(ExcerptT) bool) (ExcerptT, error) { |
| 417 | id, err := sc.resolveMatcher(f) |
no test coverage detected