Debian Codegraph @

dnsimple/domains_zones.go

raw
1 package dnsimple
2
3 import (
4 "fmt"
5 )
6
7 type zoneResponse struct {
8 Zone string `json:"zone,omitempty"`
9 }
10
11 // GetZone downloads the Bind-like zone file.
12 //
13 // DNSimple API docs: http://developer.dnsimple.com/domains/zones/#get
14 func (s *DomainsService) GetZone(domain interface{}) (string, *Response, error) {
15 path := fmt.Sprintf("%s/zone", domainPath(domain))
16 zoneResponse := zoneResponse{}
17
18 res, err := s.client.get(path, &zoneResponse)
19 if err != nil {
20 return "", res, err
21 }
22
23 return zoneResponse.Zone, res, nil
24 }