preupstream

package
v0.0.0-...-b6e3791 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL