lazyBug is a lazy-loading wrapper that fetch data from the cache (BugExcerpt) in priority, and load the complete bug and snapshot only when necessary.
| 36 | // lazyBug is a lazy-loading wrapper that fetch data from the cache (BugExcerpt) in priority, |
| 37 | // and load the complete bug and snapshot only when necessary. |
| 38 | type lazyBug struct { |
| 39 | cache *cache.RepoCache |
| 40 | excerpt *cache.BugExcerpt |
| 41 | |
| 42 | mu sync.Mutex |
| 43 | snap *bug.Snapshot |
| 44 | } |
| 45 | |
| 46 | func NewLazyBug(cache *cache.RepoCache, excerpt *cache.BugExcerpt) *lazyBug { |
| 47 | return &lazyBug{ |
nothing calls this directly
no outgoing calls
no test coverage detected