plugins

package
v0.0.0-...-1fd8329 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainRequest

func ChainRequest(conn net.PacketConn, addr net.Addr, req *dnsmessage.Message) error

ChainRequest chains each DNS request to each plugin as registered

func QuestionsToString

func QuestionsToString(req *dnsmessage.Message) string

QuestionsToString converts the questions of a DNS request to a hashable string

func Register

func Register(plugin DNSPlugin)

Register appends a new plugin

func RegisterBefore

func RegisterBefore(plugin DNSPlugin)

RegisterBefore prepends a new plugin to ensure it's run first

Types

type DNSHandler

type DNSHandler func(net.PacketConn, net.Addr, *dnsmessage.Message) error

DNSHandler main func type implemented by plugins to handle DNS requests

type DNSPlugin

type DNSPlugin interface {
	Name() string
	ServeDNS(DNSHandler) DNSHandler
}

DNSPlugin basic plugin interface

Jump to

Keyboard shortcuts

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