setup

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBlockBuilder

func BuildBlockBuilder(userSettings config.Block,
	client *http.Client) (blockBuilder *blockbuilder.Builder, err error)

Types

type Cache

type Cache interface {
	Add(request, response *dns.Msg)
	Get(request *dns.Msg) (response *dns.Msg)
}

func BuildCache

func BuildCache(userSettings config.Cache,
	metrics CacheMetrics) (cache Cache, err error)

type CacheMetrics

type CacheMetrics interface {
	SetCacheType(cacheType string)
	CacheInsertInc()
	CacheRemoveInc()
	CacheMoveInc()
	CacheGetEmptyInc()
	CacheInsertEmptyInc()
	CacheRemoveEmptyInc()
	CacheHitInc()
	CacheMissInc()
	CacheExpiredInc()
	CacheMaxEntriesSet(maxEntries int)
}

func BuildCacheMetrics

func BuildCacheMetrics(userSettings config.Metrics,
	registry PrometheusRegistry) (
	metrics CacheMetrics, err error)

type DoHMetrics

type DoHMetrics interface {
	DoHDialInc(url string)
	DoTDialInc(provider, address, outcome string)
	DNSDialInc(address, outcome string)
}

type DoTMetrics

type DoTMetrics interface {
	DoTDialInc(provider, address, outcome string)
	DNSDialInc(address, outcome string)
}

type Filter

type Filter interface {
	FilterRequest(request *dns.Msg) (blocked bool)
	FilterResponse(response *dns.Msg) (blocked bool)
	Update(settings update.Settings) (err error)
}

type FilterMetrics

type FilterMetrics interface {
	SetBlockedHostnames(n int)
	SetBlockedIPs(n int)
	SetBlockedIPPrefixes(n int)
	HostnamesFilteredInc(qClass, qType string)
	IPsFilteredInc(rrtype string)
}

func BuildFilterMetrics

func BuildFilterMetrics(userSettings config.Metrics,
	registry PrometheusRegistry) (
	metrics FilterMetrics, err error)

type Logger

type Logger interface {
	Debug(s string)
	Info(s string)
	Warn(s string)
	Error(s string)
}

type LoggerConstructor

type LoggerConstructor interface {
	New(options ...log.Option) *log.Logger
}

type Middleware

type Middleware interface {
	String() string
	Wrap(next dns.Handler) dns.Handler
	Stop() (err error)
}

type PrometheusRegistry

type PrometheusRegistry interface {
	prometheus.Registerer
}

type Service

type Service interface {
	String() string
	Start() (runError <-chan error, startErr error)
	Stop() (err error)
}

func DNS

func DNS(userSettings config.Settings, ipv6Support bool,
	cache Cache, filter Filter, loggerConstructor LoggerConstructor,
	promRegistry PrometheusRegistry) (server Service, err error)

Jump to

Keyboard shortcuts

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