Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
Cache is a cache that holds on the a number of RRs or DNS messages. The cache eviction is randomized.
func (*Cache) EvictRandom ¶
func (c *Cache) EvictRandom()
EvictRandom removes a random member a the cache. Must be called under a write lock.
func (*Cache) Hit ¶
Hit returns a dns message from the cache. If the message's TTL is expired nil is returned and the message is removed from the cache.
func (*Cache) InsertMessage ¶
InsertMessage inserts a message in the Cache. We will cache it for ttl seconds, which should be a small (60...300) integer.
Click to show internal directories.
Click to hide internal directories.