Documentation ¶
Overview ¶
Package ecscache implements a EDNS Client Subnet (ECS) aware DNS cache that can be used as a dnsserver.Middleware.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FakeECSFQDNs = map[string]struct{}{}/* 8343 elements not displayed */
FakeECSFQDNs contains all domains that indicate ECS support, but in fact don't have one.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a dnsserver.Middleware with ECS-aware caching.
func NewMiddleware ¶
func NewMiddleware(c *MiddlewareConfig) (m *Middleware)
NewMiddleware initializes a new ECS-aware LRU caching middleware. c must not be nil.
type MiddlewareConfig ¶
type MiddlewareConfig struct { // Cloner is used to clone messages taken from cache. Cloner *dnsmsg.Cloner // GeoIP is the GeoIP database used to get subnets for countries. It must // not be nil. GeoIP geoip.Interface // MinTTL is the minimum supported TTL for cache items. MinTTL time.Duration // Size is the number of entities to hold in the cache for hosts that don't // support ECS. It must be greater than zero. Size int // ECSSize is the number of entities to hold in the cache for hosts that // support ECS. It must be greater than zero. ECSSize int // UseTTLOverride shows if the TTL overrides logic should be used. UseTTLOverride bool }
MiddlewareConfig is the configuration structure for NewMiddleware.
Click to show internal directories.
Click to hide internal directories.