traefik/vendor/github.com/weppos/dnsimple-go/dnsimple/domains_zones.go

25 lines
519 B
Go
Raw Normal View History

2017-02-07 21:33:23 +00:00
package dnsimple
import (
"fmt"
)
type zoneResponse struct {
Zone string `json:"zone,omitempty"`
}
// GetZone downloads the Bind-like zone file.
//
// DNSimple API docs: http://developer.dnsimple.com/domains/zones/#get
func (s *DomainsService) GetZone(domain interface{}) (string, *Response, error) {
path := fmt.Sprintf("%s/zone", domainPath(domain))
zoneResponse := zoneResponse{}
res, err := s.client.get(path, &zoneResponse)
if err != nil {
return "", res, err
}
return zoneResponse.Zone, res, nil
}