mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
migrate code for github
This commit is contained in:
35
vendor/github.com/billputer/go-namecheap/ns.go
generated
vendored
Normal file
35
vendor/github.com/billputer/go-namecheap/ns.go
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
package namecheap
|
||||
|
||||
import "net/url"
|
||||
|
||||
const (
|
||||
nsCreate = "namecheap.domains.ns.create"
|
||||
nsDelete = "namecheap.domains.ns.delete"
|
||||
nsGetInfo = "namecheap.domains.ns.getInfo"
|
||||
nsUpdate = "namecheap.domains.ns.update"
|
||||
)
|
||||
|
||||
type DomainNSInfoResult struct {
|
||||
Domain string `xml:"Domain,attr"`
|
||||
Nameserver string `xml:"Nameserver,attr"`
|
||||
IP string `xml:"IP,attr"`
|
||||
Statuses []string `xml:"NameserverStatuses>Status"`
|
||||
}
|
||||
|
||||
func (client *Client) NSGetInfo(sld, tld, nameserver string) (*DomainNSInfoResult, error) {
|
||||
requestInfo := &ApiRequest{
|
||||
command: nsGetInfo,
|
||||
method: "GET",
|
||||
params: url.Values{},
|
||||
}
|
||||
requestInfo.params.Set("SLD", sld)
|
||||
requestInfo.params.Set("TLD", tld)
|
||||
requestInfo.params.Set("Nameserver", nameserver)
|
||||
|
||||
resp, err := client.do(requestInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp.DomainNSInfo, nil
|
||||
}
|
Reference in New Issue
Block a user