mapfilter

package
v2.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

func New

func New(settings Settings) (filter *Filter, err error)

func (*Filter) FilterRequest

func (m *Filter) FilterRequest(request *dns.Msg) (blocked bool)

func (*Filter) FilterResponse

func (m *Filter) FilterResponse(response *dns.Msg) (blocked bool)

func (*Filter) Update

func (m *Filter) Update(settings update.Settings) (err error)

type Metrics

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

type Settings

type Settings struct {
	// Update contains the filter update settings.
	Update update.Settings
	// Metrics is the metric interface and defaults
	// to a no-op implementation if left unset.
	Metrics Metrics
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

func (*Settings) ToLinesNode

func (s *Settings) ToLinesNode() (node *gotree.Node)

func (Settings) Validate

func (s Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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