| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package infrastructures |
||
| 10 | // CacheSingleton is the singleton for the ristretto cache. |
||
| 11 | type CacheSingleton struct { |
||
| 12 | cache *ristretto.Cache |
||
| 13 | } |
||
| 14 | |||
| 15 | var ( |
||
| 16 | cacheInstance *CacheSingleton //nolint:gochecknoglobals //Singleton |
||
| 17 | cacheOnce sync.Once //nolint:gochecknoglobals //Singleton |
||
| 18 | ) |
||
| 19 | |||
| 20 | // GetCacheInstance gets the cache instance. |
||
| 21 | func GetCacheInstance() *CacheSingleton { |
||
| 51 |