William Petit c4a9baf82b
Some checks failed
arcad/edge/pipeline/head There was a failure building this commit
feat: implement lfu based cache strategy
2024-01-08 21:09:45 +01:00

18 lines
357 B
Go

package expirable
import (
"time"
"forge.cadoles.com/arcad/edge/pkg/storage/driver/cache/lfu"
)
type Cache[K comparable, V any] struct {
ttl time.Duration
cache *lfu.Cache[K, V]
timestamps *lfu.Map[K, time.Duration]
}
func NewCache[K comparable, V any](cache *lfu.Cache[K, V], ttl time.Duration) *Cache[K, V] {
return &Cache[K, V]{}
}