Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chunks ¶
Chunks splits strings into arrays of a certain chunk size. We use this to split TXT records into 255 sized chunks for RFC 4408 https://tools.ietf.org/html/rfc4408#section-3.1.3 Borrowed from https://stackoverflow.com/a/61469854/11477663
Types ¶
type CachingResolver ¶
type CachingResolver interface { Resolver ChangedRecords() []string ResolveErrors() []error Save(filename string) error }
CachingResolver wraps a live resolver and adds caching to it. GetSPF will always return the cached value, if present. It will also query the inner resolver and compare results. If a given lookup has inconsistencies between cache and live, GetSPF will return the cached result. All records queries will be stored for the lifetime of the resolver, and can be flushed to disk at the end. All resolution errors from the inner resolver will be saved and can be retreived later.
func NewCache ¶
func NewCache(filename string) (CachingResolver, error)
NewCache creates a new cache file named filename.
type LiveResolver ¶
type LiveResolver struct{}
LiveResolver simply queries DNS to resolve SPF records.
type SPFRecord ¶
type SPFRecord struct {
Parts []*SPFPart
}
SPFRecord stores the parts of an SPF record.
func (*SPFRecord) TXTSplit ¶
TXTSplit returns a set of txt records to use for SPF. pattern given is used to name all chained spf records. patern should include %d, which will be replaced by a counter. should result in fqdn after replacement returned map will have keys with fqdn of resulting records. root record will be under key "@" overhead specifies that the first split part should assume an overhead of that many bytes. For example, if there are other txt records and you wish to reduce the first SPF record size to prevent DNS over TCP.