Documentation ¶
Index ¶
- func Key(q dns.Question, dnssec, tcp bool) string
- func KeyRRset(rrs []dns.RR) string
- type Cache
- func (c *Cache) Capacity() int
- func (c *Cache) EvictRandom()
- func (c *Cache) Hit(question dns.Question, dnssec, tcp bool, msgid uint16) *dns.Msg
- func (c *Cache) InsertMessage(s string, msg *dns.Msg)
- func (c *Cache) InsertSignature(s string, sig *dns.RRSIG)
- func (c *Cache) Remove(s string)
- func (c *Cache) Search(s string) (*dns.Msg, time.Time, bool)
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 ¶ added in v1.0.7
func (c *Cache) EvictRandom()
EvictRandom removes a random member a the cache. Must be called under a write lock.
func (*Cache) Hit ¶ added in v1.0.7
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.
func (*Cache) InsertSignature ¶
InsertSignature inserts a signature, the expiration time is used as the cache ttl.
Click to show internal directories.
Click to hide internal directories.