Skip to content

Commit

Permalink
rename based on new standard
Browse files Browse the repository at this point in the history
  • Loading branch information
tlimoncelli committed Jan 10, 2025
1 parent 1e578d7 commit c6e8c53
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion models/t_mx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (rc *RecordConfig) SetTargetMX(pref uint16, target string) error {

// SetTargetMXStrings is like SetTargetMX but accepts strings.
func (rc *RecordConfig) SetTargetMXStrings(pref, target string) error {
return PopulateMXRaw(rc, []string{rc.Name, pref, target}, nil, "")
return PopulateFromRawMX(rc, []string{rc.Name, pref, target}, nil, "")
}

// SetTargetMXString is like SetTargetMX but accepts one big string.
Expand Down
2 changes: 1 addition & 1 deletion models/t_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (rc *RecordConfig) PopulateFromStringFunc(rtype, contents, origin string, t
case "MX":
//fmt.Printf("DEBUG: contents=%q\n", contents)
//fmt.Printf("DEBUG: PopulateMXRaw(rc, fields=%v, nil, %q)\n", append([]string{rc.Name}, strings.Fields(contents)...), origin)
return PopulateMXRaw(rc, append([]string{rc.Name}, strings.Fields(contents)...), nil, origin)
return PopulateFromRawMX(rc, append([]string{rc.Name}, strings.Fields(contents)...), nil, origin)
case "NAPTR":
return rc.SetTargetNAPTRString(contents)
case "SOA":
Expand Down
6 changes: 3 additions & 3 deletions models/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PopulateAFields()

func init() {
RegisterType("A", RegisterOpts{FromRaw: PopulateARaw})
RegisterType("MX", RegisterOpts{FromRaw: PopulateMXRaw})
RegisterType("MX", RegisterOpts{FromRaw: PopulateFromRawMX})
RegisterType("SRV", RegisterOpts{FromRaw: PopulateSRVRaw})
//fmt.Printf("DEBUG: REGISTERED A\n")
}
Expand Down Expand Up @@ -126,8 +126,8 @@ type MX struct {
Mx string
}

// PopulateMXRaw updates rc to be an MX record with contents from rawfields, meta and origin.
func PopulateMXRaw(rc *RecordConfig, rawfields []string, meta map[string]string, origin string) error {
// PopulateFromRawMX updates rc to be an MX record with contents from rawfields, meta and origin.
func PopulateFromRawMX(rc *RecordConfig, rawfields []string, meta map[string]string, origin string) error {
var err error

// Error checking
Expand Down
4 changes: 2 additions & 2 deletions providers/msdns/powershell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func Test_generatePSModify(t *testing.T) {
recMX2 := &models.RecordConfig{}
models.PopulateARaw(recA1, []string{"@", "1.2.3.4"}, nil, "example.com")
models.PopulateARaw(recA2, []string{"@", "10.20.30.40"}, nil, "example.com")
models.PopulateMXRaw(recMX1, []string{"@", "5", "foo.com."}, nil, "example.com")
models.PopulateMXRaw(recMX2, []string{"@", "50", "foo2.com."}, nil, "example.com")
models.PopulateFromRawMX(recMX1, []string{"@", "5", "foo.com."}, nil, "example.com")
models.PopulateFromRawMX(recMX2, []string{"@", "50", "foo2.com."}, nil, "example.com")

type args struct {
domain string
Expand Down

0 comments on commit c6e8c53

Please sign in to comment.