Documentation
¶
Overview ¶
Package exdns contains helpers to work with dns.Msg
Index ¶
- func AsServerAddress(server string) (string, error)
- func Decanonize(qName string) string
- func ForEachAnswer[T dns.RR](msg *dns.Msg, fn func(v T))
- func GetFirstAnswer[T dns.RR](msg *dns.Msg) T
- func HasAnswerType(msg *dns.Msg, qType uint16) bool
- func HasNsType(msg *dns.Msg, qType uint16) bool
- func TrimQ(s []dns.Question, cond func(q dns.Question) bool) []dns.Question
- func TrimRR(s []dns.RR, cond func(rr dns.RR) bool) []dns.RR
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsServerAddress ¶
AsServerAddress validates and optionally appends :53 port if it wasn't specified already
func Decanonize ¶
Decanonize removes the trailing . if present, unless it's the root dot
func ForEachAnswer ¶
ForEachAnswer calls a function for each answer of the specified type.
func GetFirstAnswer ¶
GetFirstAnswer returns the first answer for a specified type
func HasAnswerType ¶
HasAnswerType checks if a dns.Msg contains answers of the specified type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.