mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 04:01:34 +00:00
26 lines
488 B
Go
26 lines
488 B
Go
package cache
|
|
|
|
import (
|
|
"time"
|
|
|
|
platform_cache "tercul/internal/platform/cache"
|
|
)
|
|
|
|
type Options struct {
|
|
Enabled bool
|
|
Cache platform_cache.Cache
|
|
Keys platform_cache.KeyGenerator
|
|
EntityTTL time.Duration
|
|
ListTTL time.Duration
|
|
}
|
|
|
|
func DefaultOptions(c platform_cache.Cache) Options {
|
|
return Options{
|
|
Enabled: c != nil,
|
|
Cache: c,
|
|
Keys: platform_cache.NewDefaultKeyGenerator("tercul:repo:"),
|
|
EntityTTL: 1 * time.Hour,
|
|
ListTTL: 5 * time.Minute,
|
|
}
|
|
}
|