Dmitriy Gnatenko 1b9d3a6ed8 Add LRU memory cache 6 meses atrás
..
cache.go 1b9d3a6ed8 Add LRU memory cache 6 meses atrás
cache_config.go 9c20f6f267 Add TTL cache 6 meses atrás
readme.md 1b9d3a6ed8 Add LRU memory cache 6 meses atrás

readme.md

Usage example

cache := NewCache(
    NewConfig(
        memoryCache.WithCleanupInterval(30*time.Minute),
        memoryCache.WithExpiration(time.Hour),
    ),
)

cache.Set("1", "value 1", nil)

exp := 12*time.Hour
cache.Set("2", "value 2", &exp)
	
val1, found1 := cache.Get("1") // "value 1", true
val3, found3 := cache.Get("3") // nil, false