2021-07-17 09:06:33 +00:00
|
|
|
package cache
|
|
|
|
|
|
|
|
import (
|
2021-07-18 05:28:24 +00:00
|
|
|
"log"
|
2021-07-17 09:06:33 +00:00
|
|
|
"time"
|
|
|
|
|
2021-07-18 05:28:24 +00:00
|
|
|
"github.com/allegro/bigcache/v3"
|
2021-07-17 09:06:33 +00:00
|
|
|
)
|
|
|
|
|
2021-07-18 05:28:24 +00:00
|
|
|
func InMemory() *bigcache.BigCache {
|
|
|
|
cache, err := bigcache.NewBigCache(bigcache.DefaultConfig(6 * time.Hour))
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
2021-07-17 09:06:33 +00:00
|
|
|
return cache
|
|
|
|
}
|