forked from fredericalix/ovhcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdomain.go
63 lines (49 loc) · 1.72 KB
/
domain.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package ovh
import (
"fmt"
)
// Domain ...
type Domain struct {
// "Is whois obfuscation supported by this domain name's registry"
OwoSupported bool `json:"owoSupported,omitempty"`
// "Does the registry support ipv6 glue record"
GlueRecordIpv6Supported bool `json:"glueRecordIpv6Supported,omitempty"`
// "Transfer lock status"
TransferLockStatus string `json:"transferLockStatus,omitempty"`
//fullType: "domain.DomainLockStatusEnum"
// "Domain's offer"
Offer string `json:"offer,omitempty"`
//fullType: "domain.OfferEnum"
// "Contact Owner (you can edit it via /me/contact/<ID>)"
WhoisOwner string `json:"whoisOwner,omitempty"`
// "Is DNSSEC implemented for this domain name's tld"
DnssecSupported bool `json:"dnssecSupported,omitempty"`
// "Parent service"
ParentService *string `json:"parentService,omitempty"`
//fullType: "domain.ParentService"
// "Domain name"
Domain string `json:"domain"`
// "Last update date"
LastUpdate string `json:"lastUpdate,omitempty"`
// "Does the registry support multi ip glue record"
GlueRecordMultiIPSupported bool `json:"glueRecordMultiIpSupported,omitempty"`
// "Name servers type"
NameServerType string `json:"nameServerType,omitempty"`
//fullType: "domain.DomainNsTypeEnum"
}
// DomainList list all your domain
func (c *Client) DomainList() ([]Domain, error) {
var names []string
e := c.OVHClient.Get("/domain", &names)
domains := []Domain{}
for _, name := range names {
domains = append(domains, Domain{Domain: name})
}
return domains, e
}
// DomainInfo retrieve all infos of one of your domains
func (c *Client) DomainInfo(domainName string) (*Domain, error) {
domain := &Domain{}
err := c.OVHClient.Get(fmt.Sprintf("/domain/%s", domainName), domain)
return domain, err
}