LittleSheep 4cf3742a75
Some checks failed
release-nightly / build-docker (push) Has been cancelled
🎉 Initial Commit
2025-01-25 18:33:11 +08:00

25 lines
426 B
Go

package cache
import (
"github.com/dgraph-io/ristretto"
"github.com/eko/gocache/lib/v4/store"
ristrettoCache "github.com/eko/gocache/store/ristretto/v4"
)
var S store.StoreInterface
func NewStore() error {
ristretto, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 1000,
MaxCost: 100,
BufferItems: 64,
})
if err != nil {
return err
}
S = ristrettoCache.NewRistretto(ristretto)
return nil
}