msgutil

package
v0.0.0-...-103a051 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectRRs

func CollectRRs[T dns.RR](rrs []dns.RR) []T

CollectRRs takes a slice of [github.com/miekg/dns.RR]s and returns a slice of with the [github.com/miekg/dns.RR]s of type T. If not such records exist, the function returns a zero-length slice.

func OrderCNAMEs

func OrderCNAMEs(a []*dns.CNAME) bool

OrderCNAMEs takes a slice of *github.com/miekg/dns.CNAME and attempts to the sort the slice such that entry i's Target is entry i's Name. We call this a "CNAME chain". If the sort is successful, OrderCNAMEs returns true; otherwise, it returns false. Note that, even if OrderCNAMEs cannot sort the entries into CNAME chain, the function may permute the order of the elements in the slice. An argument that is nil slice or a zero-length slice is considered sorted.

Types

type AddressRecord

type AddressRecord struct {
	Name string
	Addr netip.Addr
}

Covers both A and AAAA records

func CollectAAAARecords

func CollectAAAARecords(rrs []dns.RR) []*AddressRecord

func CollectARecords

func CollectARecords(rrs []dns.RR) []*AddressRecord

Jump to

Keyboard shortcuts

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