File: domains_zones.go

package info (click to toggle)
golang-github-weppos-dnsimple-go 0.0~git20160204.0.65c1ca7-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 144 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
}