go update

This commit is contained in:
saces 2026-02-15 15:21:12 +01:00
parent c7ffc9adc7
commit c228c32f6c
5 changed files with 545 additions and 1150 deletions

View file

@ -25,23 +25,25 @@ func init() {
}
func record_to_rr(zone string, record libdns.Record) (dns.RR, error) {
maybe_priority := ""
if record.Priority != 0 {
maybe_priority += strconv.FormatInt(int64(record.Priority), 10)
maybe_priority += " "
}
/*
maybe_priority := ""
if record.Priority != 0 {
maybe_priority += strconv.FormatInt(int64(record.Priority), 10)
maybe_priority += " "
}
*/
//TODO: consider fixing this with dns.StringToType & dns.TypeToRR
// Problem is putting the value in, since it will be a different field
// for every type.
// Also, will probably require parsing the value anyway (e.g. to net.IP)
//TODO: does the value need to be escaped?!
return dns.NewRR(
dns.Fqdn(record.Name+"."+zone) +
dns.Fqdn(record.RR().Name+"."+zone) +
" " +
strconv.FormatInt(int64(record.TTL.Seconds()), 10) +
strconv.FormatInt(int64(record.RR().TTL.Seconds()), 10) +
" IN " +
record.Type +
record.RR().Type +
" " +
maybe_priority +
record.Value)
// maybe_priority +
record.RR().Data)
}