mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
This commit is contained in:
committed by
Craig Peterson
parent
e1af3034c7
commit
9d0f9a1531
@ -355,20 +355,20 @@ type cfRecData struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type cfRecord struct {
|
type cfRecord struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Proxiable bool `json:"proxiable"`
|
Proxiable bool `json:"proxiable"`
|
||||||
Proxied bool `json:"proxied"`
|
Proxied bool `json:"proxied"`
|
||||||
TTL uint32 `json:"ttl"`
|
TTL uint32 `json:"ttl"`
|
||||||
Locked bool `json:"locked"`
|
Locked bool `json:"locked"`
|
||||||
ZoneID string `json:"zone_id"`
|
ZoneID string `json:"zone_id"`
|
||||||
ZoneName string `json:"zone_name"`
|
ZoneName string `json:"zone_name"`
|
||||||
CreatedOn time.Time `json:"created_on"`
|
CreatedOn time.Time `json:"created_on"`
|
||||||
ModifiedOn time.Time `json:"modified_on"`
|
ModifiedOn time.Time `json:"modified_on"`
|
||||||
Data *cfRecData `json:"data"`
|
Data *cfRecData `json:"data"`
|
||||||
Priority uint16 `json:"priority"`
|
Priority json.Number `json:"priority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
||||||
@ -384,7 +384,13 @@ func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
|||||||
rc.SetLabelFromFQDN(c.Name, domain)
|
rc.SetLabelFromFQDN(c.Name, domain)
|
||||||
switch rType := c.Type; rType { // #rtype_variations
|
switch rType := c.Type; rType { // #rtype_variations
|
||||||
case "MX":
|
case "MX":
|
||||||
if err := rc.SetTargetMX(c.Priority, c.Content); err != nil {
|
var priority uint16
|
||||||
|
if p, err := c.Priority.Int64(); err != nil {
|
||||||
|
panic(errors.Wrap(err, "error decoding priority from cloudflare record"))
|
||||||
|
} else {
|
||||||
|
priority = uint16(p)
|
||||||
|
}
|
||||||
|
if err := rc.SetTargetMX(priority, c.Content); err != nil {
|
||||||
panic(errors.Wrap(err, "unparsable MX record received from cloudflare"))
|
panic(errors.Wrap(err, "unparsable MX record received from cloudflare"))
|
||||||
}
|
}
|
||||||
case "SRV":
|
case "SRV":
|
||||||
|
Reference in New Issue
Block a user