logs-analyzer/signoz/pkg/query-service/cache/inmemory/options.go
2024-09-02 22:47:30 +03:00

24 lines
540 B
Go

package inmemory
import (
"time"
go_cache "github.com/patrickmn/go-cache"
)
const (
defaultTTL = go_cache.NoExpiration
defaultCleanupInterval = 1 * time.Minute
)
// Options holds the options for the in-memory cache
type Options struct {
// TTL is the time to live for the cache entries
TTL time.Duration `yaml:"ttl,omitempty"`
CleanupInterval time.Duration `yaml:"cleanupInterval,omitempty"`
}
func defaultOptions() *Options {
return &Options{TTL: defaultTTL, CleanupInterval: defaultCleanupInterval}
}