Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultShards is the number of cache shards for concurrent access. // Higher values reduce lock contention but increase memory overhead. DefaultShards = 1024 // DefaultLifeWindow is the maximum age of cached DNS responses. // After this duration, entries are evicted regardless of DNS TTL. DefaultLifeWindow = time.Minute // DefaultCleanWindow is the interval between cleanup cycles. // Lower values free memory faster but increase CPU usage. DefaultCleanWindow = 30 * time.Second // DefaultMaxEntriesInWindow estimates peak entries during LifeWindow. // Used for initial memory allocation (1000 entries/sec * 60 sec). DefaultMaxEntriesInWindow = 1000 * 10 * 60 // DefaultMaxEntrySize is the maximum size of a single DNS message in bytes. // Larger responses will fail to cache. Typical DNS-over-UDP limit is 512 bytes. DefaultMaxEntrySize = 500 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.