Compare commits
No commits in common. "70ff03f233a931f3b4ef7b0654f1aac52af216bc" and "bc1c3842ee5d6959a8276fff4e2a6954b2df2c67" have entirely different histories.
70ff03f233
...
bc1c3842ee
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
|||||||
module go.balki.me/cloudflare-dns-cli
|
module go.balki.me/cloudflare-dns-cli
|
||||||
|
|
||||||
go 1.22.2
|
go 1.22.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/libdns/cloudflare v0.1.1
|
github.com/libdns/cloudflare v0.1.1
|
||||||
|
1
main.go
1
main.go
@ -36,7 +36,6 @@ func genRecord() (libdns.Record, error) {
|
|||||||
Type: "MX",
|
Type: "MX",
|
||||||
Name: sub,
|
Name: sub,
|
||||||
Value: cname,
|
Value: cname,
|
||||||
Priority: 10,
|
|
||||||
}, nil
|
}, nil
|
||||||
} else {
|
} else {
|
||||||
return libdns.Record{
|
return libdns.Record{
|
||||||
|
10
vendor/github.com/libdns/cloudflare/models.go
generated
vendored
10
vendor/github.com/libdns/cloudflare/models.go
generated
vendored
@ -62,7 +62,6 @@ type cfDNSRecord struct {
|
|||||||
ZoneName string `json:"zone_name,omitempty"`
|
ZoneName string `json:"zone_name,omitempty"`
|
||||||
CreatedOn time.Time `json:"created_on,omitempty"`
|
CreatedOn time.Time `json:"created_on,omitempty"`
|
||||||
ModifiedOn time.Time `json:"modified_on,omitempty"`
|
ModifiedOn time.Time `json:"modified_on,omitempty"`
|
||||||
Priority uint `json:"priority,omitempty"`
|
|
||||||
Data struct {
|
Data struct {
|
||||||
// LOC
|
// LOC
|
||||||
LatDegrees int `json:"lat_degrees,omitempty"`
|
LatDegrees int `json:"lat_degrees,omitempty"`
|
||||||
@ -123,17 +122,13 @@ func (r cfDNSRecord) libdnsRecord(zone string) libdns.Record {
|
|||||||
}
|
}
|
||||||
return srv.ToRecord()
|
return srv.ToRecord()
|
||||||
}
|
}
|
||||||
out := libdns.Record{
|
return libdns.Record{
|
||||||
Type: r.Type,
|
Type: r.Type,
|
||||||
Name: libdns.RelativeName(r.Name, zone),
|
Name: libdns.RelativeName(r.Name, zone),
|
||||||
Value: r.Content,
|
Value: r.Content,
|
||||||
TTL: time.Duration(r.TTL) * time.Second,
|
TTL: time.Duration(r.TTL) * time.Second,
|
||||||
ID: r.ID,
|
ID: r.ID,
|
||||||
}
|
}
|
||||||
if r.Type == "MX" {
|
|
||||||
out.Priority = r.Priority
|
|
||||||
}
|
|
||||||
return out
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func cloudflareRecord(r libdns.Record) (cfDNSRecord, error) {
|
func cloudflareRecord(r libdns.Record) (cfDNSRecord, error) {
|
||||||
@ -157,9 +152,6 @@ func cloudflareRecord(r libdns.Record) (cfDNSRecord, error) {
|
|||||||
} else {
|
} else {
|
||||||
rec.Name = r.Name
|
rec.Name = r.Name
|
||||||
rec.Content = r.Value
|
rec.Content = r.Value
|
||||||
if r.Type == "MX" {
|
|
||||||
rec.Priority = r.Priority
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return rec, nil
|
return rec, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user