mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Make it easier to add new Rtypes. (#169)
* NEW: docs/adding-new-rtypes.md * Mark all "if" and "switch" statements with `#rtype_variations` * Make consistent use of `default: panic()`
This commit is contained in:
@ -127,7 +127,7 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
switch rec.Type {
|
||||
switch rec.Type { // #rtype_variations
|
||||
case "A":
|
||||
check(checkIPv4(target))
|
||||
case "AAAA":
|
||||
@ -192,7 +192,7 @@ func importTransform(srcDomain, dstDomain *models.DomainConfig, transforms []tra
|
||||
}
|
||||
return rec2
|
||||
}
|
||||
switch rec.Type {
|
||||
switch rec.Type { // #rtype_variations
|
||||
case "A":
|
||||
trs, err := transform.TransformIPToList(net.ParseIP(rec.Target), transforms)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user