GetGlobalCache returns the global cache instance.
()
| 473 | |
| 474 | // GetGlobalCache returns the global cache instance. |
| 475 | func GetGlobalCache() Cache { |
| 476 | if globalCache == nil { |
| 477 | // If global cache is not initialized, use a temporary in-memory cache |
| 478 | globalCache = NewMemoryCache() |
| 479 | } |
| 480 | |
| 481 | return globalCache |
| 482 | } |
| 483 | |
| 484 | // GetBadgerCache returns the global cache as a BadgerCache if applicable. |
| 485 | func GetBadgerCache() (*BadgerCache, bool) { |