forked from TrueCloudLab/lego
bba134ce87
* feat: add GetOrDefaultXXX methods. * refactor: configuration (alidns). * refactor: configuration (azure). * refactor: configuration (auroradns). * refactor: configuration (bluecat). * refactor: configuration (cloudflare). * refactor: configuration (digitalocean). * refactor: configuration (dnsimple). * refactor: configuration (dnmadeeasy). * refactor: configuration (dnspod). * refactor: configuration (duckdns). * refactor: configuration (dyn). * refactor: configuration (exoscale). * refactor: configuration (fastdns). * refactor: configuration (gandi). * refactor: configuration (gandiv5). * refactor: configuration (gcloud). * refactor: configuration (glesys). * refactor: configuration (godaddy). * refactor: configuration (iij). * refactor: configuration (lightsail). * refactor: configuration (linode). * refactor: configuration (namecheap). * refactor: configuration (namedotcom). * refactor: configuration (netcup). * refactor: configuration (nifcloud). * refactor: configuration (ns1). * refactor: configuration (otc). * refactor: configuration (ovh). * refactor: configuration (pdns). * refactor: configuration (rackspace). * refactor: configuration (rfc2136). * refactor: configuration (route53). * refactor: configuration (sakuracloud). * refactor: configuration (vegadns). * refactor: configuration (vultr).
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package namecheap
|
|
|
|
import "encoding/xml"
|
|
|
|
// host describes a DNS record returned by the Namecheap DNS gethosts API.
|
|
// Namecheap uses the term "host" to refer to all DNS records that include
|
|
// a host field (A, AAAA, CNAME, NS, TXT, URL).
|
|
type host struct {
|
|
Type string `xml:",attr"`
|
|
Name string `xml:",attr"`
|
|
Address string `xml:",attr"`
|
|
MXPref string `xml:",attr"`
|
|
TTL string `xml:",attr"`
|
|
}
|
|
|
|
// apierror describes an error record in a namecheap API response.
|
|
type apierror struct {
|
|
Number int `xml:",attr"`
|
|
Description string `xml:",innerxml"`
|
|
}
|
|
|
|
type setHostsResponse struct {
|
|
XMLName xml.Name `xml:"ApiResponse"`
|
|
Status string `xml:"Status,attr"`
|
|
Errors []apierror `xml:"Errors>Error"`
|
|
Result struct {
|
|
IsSuccess string `xml:",attr"`
|
|
} `xml:"CommandResponse>DomainDNSSetHostsResult"`
|
|
}
|
|
|
|
type getHostsResponse struct {
|
|
XMLName xml.Name `xml:"ApiResponse"`
|
|
Status string `xml:"Status,attr"`
|
|
Errors []apierror `xml:"Errors>Error"`
|
|
Hosts []host `xml:"CommandResponse>DomainDNSGetHostsResult>host"`
|
|
}
|
|
|
|
type getTldsResponse struct {
|
|
XMLName xml.Name `xml:"ApiResponse"`
|
|
Errors []apierror `xml:"Errors>Error"`
|
|
Result []struct {
|
|
Name string `xml:",attr"`
|
|
} `xml:"CommandResponse>Tlds>Tld"`
|
|
}
|