mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
draft!
This commit is contained in:
@@ -427,7 +427,7 @@ func (rc *RecordConfig) ToRR() dns.RR {
|
||||
rr.(*dns.SOA).Expire = rc.SoaExpire
|
||||
rr.(*dns.SOA).Minttl = rc.SoaMinttl
|
||||
case dns.TypeSPF:
|
||||
rr.(*dns.SPF).Txt = rc.TxtStrings
|
||||
rr.(*dns.SPF).Txt = []string{rc.target}
|
||||
case dns.TypeSRV:
|
||||
rr.(*dns.SRV).Priority = rc.SrvPriority
|
||||
rr.(*dns.SRV).Weight = rc.SrvWeight
|
||||
@@ -443,7 +443,7 @@ func (rc *RecordConfig) ToRR() dns.RR {
|
||||
rr.(*dns.TLSA).Selector = rc.TlsaSelector
|
||||
rr.(*dns.TLSA).Certificate = rc.GetTargetField()
|
||||
case dns.TypeTXT:
|
||||
rr.(*dns.TXT).Txt = rc.TxtStrings
|
||||
rr.(*dns.TXT).Txt = []string{rc.target}
|
||||
default:
|
||||
panic(fmt.Sprintf("ToRR: Unimplemented rtype %v", rc.Type))
|
||||
// We panic so that we quickly find any switch statements
|
||||
|
||||
@@ -49,13 +49,13 @@ func (rc *RecordConfig) SetTargetTXT(s string) error {
|
||||
// SetTargetTXTs sets the TXT fields when there are many strings.
|
||||
// The individual strings are stored in .TxtStrings, and joined to make .Target.
|
||||
func (rc *RecordConfig) SetTargetTXTs(s []string) error {
|
||||
if rc.Type == "" {
|
||||
rc.Type = "TXT"
|
||||
} else if !rc.HasFormatIdenticalToTXT() {
|
||||
panic("assertion failed: SetTargetTXTs called when .Type is not TXT or compatible type")
|
||||
}
|
||||
// if rc.Type == "" {
|
||||
// rc.Type = "TXT"
|
||||
// } else if !rc.HasFormatIdenticalToTXT() {
|
||||
// panic("assertion failed: SetTargetTXTs called when .Type is not TXT or compatible type")
|
||||
// }
|
||||
|
||||
rc.SetTarget(strings.Join(s))
|
||||
rc.SetTargetTXT(strings.Join(s, ""))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ func (rc *RecordConfig) GetTargetTXTJoined() string {
|
||||
// "foo bar" << 1 string
|
||||
// "foo" "bar" << 2 strings
|
||||
// foo << error. No quotes! Did you intend to use SetTargetTXT?
|
||||
//
|
||||
// Deprecated: GetTargetTXTJoined is deprecated. ...or should be.
|
||||
func (rc *RecordConfig) SetTargetTXTfromRFC1035Quoted(s string) error {
|
||||
if s != "" && s[0] != '"' {
|
||||
|
||||
@@ -21,7 +21,7 @@ Not the best design, but we're stuck with it until we re-do RecordConfig, possib
|
||||
var debugWarnTxtField = false
|
||||
|
||||
// GetTargetField returns the target. There may be other fields (for example
|
||||
// an MX record also has a .MxPreference field.
|
||||
// an MX record also has a .MxPreference field; they are not included.
|
||||
func (rc *RecordConfig) GetTargetField() string {
|
||||
return rc.target
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user