options.go
options.go - Overview
- Overview
This file defines the configuration options for the in-memory cache, including TTL (time-to-live) and cleanup interval.
- Detailed Documentation
Constants
-
defaultTTL
- Purpose: Defines the default time-to-live for cache entries, set to no expiration.
- Value:
go_cache.NoExpiration
- Type:
go_cache.Expiration
-
defaultCleanupInterval
- Purpose: Defines the default interval for cleaning up expired cache entries.
- Value:
1 * time.Minute
- Type:
time.Duration
type Options
- Purpose: Holds the configuration options for the in-memory cache.
- Fields:
TTL
- Purpose: The time to live for cache entries.
- Type:
time.Duration
CleanupInterval
- Purpose: The interval at which the cache is cleaned up to remove expired entries.
- Type:
time.Duration
func defaultOptions() *Options
- Purpose: Returns a pointer to an
Options
struct with default values for TTL and CleanupInterval. - Returns:
- Type:
*Options
- Description: A pointer to an
Options
struct initialized withdefaultTTL
anddefaultCleanupInterval
.
- Type:
- Code Examples
None
- Clarity and Accuracy
The documentation reflects the code accurately.
- Markdown & MDX Perfection
No issues found.
- Edge Cases To Avoid Breaking MDX
No issues found.
- Getting Started Relevance
Include in Getting Started: NO