Documentation ¶
Overview ¶
Package preupstream contains the middleware that prepares records for upstream handling and caches them, as well as records anonymous DNS statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Cloner is used to clone messages taken from cache. Cloner *dnsmsg.Cloner // DB is used to update anonymous statistics about DNS queries. DB dnsdb.Interface // GeoIP is the GeoIP database used to detect geographic data about IP // addresses in requests and responses. GeoIP geoip.Interface // CacheMinTTL is the minimum supported TTL for cache items. CacheMinTTL time.Duration // CacheSize is the size of the DNS cache for domain names that don't // support ECS. CacheSize int // ECSCacheSize is the size of the DNS cache for domain names that support // ECS. ECSCacheSize int // UseECSCache shows if the EDNS Client Subnet (ECS) aware cache should be // used. UseECSCache bool // UseCacheTTLOverride shows if the TTL overrides logic should be used. UseCacheTTLOverride bool }
Config is the configurational structure for the preupstream middleware. DB must not be nil.
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a middleware that prepares records for caching and upstream handling as well as records anonymous DNS statistics.
func New ¶
func New(c *Config) (mw *Middleware)
New returns a new preupstream middleware. c must not be nil.
func (*Middleware) Wrap ¶
func (mw *Middleware) Wrap(next dnsserver.Handler) (wrapped dnsserver.Handler)
Wrap implements the dnsserver.Middleware interface for *Middleware.
Click to show internal directories.
Click to hide internal directories.