mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Add SRV Record Type (#136)
* Add support for SRV records for NAMEDOTCOM and ROUTE53. * Improve docs * Rename RR() to ToRR(). * Rename RecordConfig Priority to MxPreference (affects json IR data)
This commit is contained in:
@@ -33,11 +33,7 @@ type differ struct {
|
||||
|
||||
// get normalized content for record. target, ttl, mxprio, and specified metadata
|
||||
func (d *differ) content(r *models.RecordConfig) string {
|
||||
content := fmt.Sprintf("%s %d", r.Target, r.TTL)
|
||||
if r.Type == "MX" {
|
||||
content += fmt.Sprintf(" priority=%d", r.Priority)
|
||||
}
|
||||
|
||||
content := fmt.Sprintf("%v ttl=%d", r.Content(), r.TTL)
|
||||
for _, f := range d.extraValues {
|
||||
for k, v := range f(r) {
|
||||
content += fmt.Sprintf(" %s=%s", k, v)
|
||||
|
@@ -94,8 +94,8 @@ func TestMxPrio(t *testing.T) {
|
||||
desired := []*models.RecordConfig{
|
||||
myRecord("www MX 1 1.1.1.1"),
|
||||
}
|
||||
existing[0].Priority = 10
|
||||
desired[0].Priority = 20
|
||||
existing[0].MxPreference = 10
|
||||
desired[0].MxPreference = 20
|
||||
checkLengths(t, existing, desired, 0, 0, 0, 1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user