cachedScanner is a scanner that caches the result of the underlying scanner.
| 11 | |
| 12 | // cachedScanner is a scanner that caches the result of the underlying scanner. |
| 13 | type cachedScanner struct { |
| 14 | scanner Scanner |
| 15 | |
| 16 | mtx sync.RWMutex |
| 17 | lastUpdatedAt time.Time |
| 18 | ttl time.Duration |
| 19 | |
| 20 | active, deleting, deleted []string |
| 21 | |
| 22 | requests prometheus.Counter |
| 23 | hits prometheus.Counter |
| 24 | } |
| 25 | |
| 26 | func newCachedScanner(scanner Scanner, cfg UsersScannerConfig, reg prometheus.Registerer) *cachedScanner { |
| 27 | return &cachedScanner{ |
nothing calls this directly
no outgoing calls
no test coverage detected