Upgrade to ttlcache/v3

This commit is contained in:
Deluan
2024-06-21 17:57:43 -04:00
parent 29b7b740ce
commit 3993c4d17f
7 changed files with 72 additions and 78 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import (
const cacheSizeLimit = 100
type HTTPClient struct {
cache SimpleCache[string]
cache SimpleCache[string, string]
hc httpDoer
ttl time.Duration
}
@@ -32,7 +32,7 @@ type requestData struct {
func NewHTTPClient(wrapped httpDoer, ttl time.Duration) *HTTPClient {
c := &HTTPClient{hc: wrapped, ttl: ttl}
c.cache = NewSimpleCache[string](Options{
c.cache = NewSimpleCache[string, string](Options{
SizeLimit: cacheSizeLimit,
DefaultTTL: ttl,
})