tests: cache

This commit is contained in:
Felipe M 2025-03-23 23:37:26 +01:00
parent 92732f9682
commit 597feb7b54
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
8 changed files with 822 additions and 32 deletions

14
cache/options.go vendored Normal file
View file

@ -0,0 +1,14 @@
package cache
import (
"time"
"git.nakama.town/fmartingr/gotoolkit/model"
)
func WithTTL(ttl time.Duration) model.CacheOption {
return func(item *model.CacheItem) {
exp := time.Now().Add(ttl)
item.TTL = &exp
}
}