Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides a proactive and expiring caching layer for DNS queries. All public methods of Cache are threadsafe.
func New ¶
func New(bufferSize int, cacheMaxTTL, cacheMissTTL time.Duration, lookup func(Context, dns.Question) []dns.RR) *Cache
New creates a DNS cache with the given DNS lookup function
func (*Cache) Clear ¶
func (c *Cache) Clear()
Clear will remove all recorded answers from the cache.
func (*Cache) Insert ¶
Insert will insert the given resource records into the cache as a response. to the given question
type Context ¶
Context provides contextual information about a DNS lookup, including what event triggered the lookup, when the looup was started, and any additional data that was provided in the original request.
Click to show internal directories.
Click to hide internal directories.