- Added helper function `ExpandUser` - Added basic cache impmentations for in-memory and file based caches. Reviewed-on: #1 Co-authored-by: Felipe M. <me@fmartingr.com> Co-committed-by: Felipe M. <me@fmartingr.com>
14 lines
223 B
Go
14 lines
223 B
Go
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
|
|
}
|
|
}
|