Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateRecord(name string, ttl int, t string, value string, zone string) (Record, error)
- func (c *Client) DeleteRecord(id string) error
- func (c *Client) GetAllRecords() ([]Record, error)
- func (c *Client) GetAllRecordsByZone(zone string) ([]Record, error)
- func (c *Client) GetAllZones() ([]Zone, error)
- func (c *Client) GetZoneByName(name string) (Zone, error)
- type Meta
- type Pagination
- type Record
- type Records
- type TXTVerification
- type Zone
- type Zones
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAPIKey = errors.New("no API key found in request") ErrInvalidAPIKey = errors.New("invalid authentication credentials") ErrZoneNotFound = errors.New("zone not found") ErrInvalidArgument = errors.New("invalid argument") ErrInvalidARecord = errors.New("invalid A record") ErrInvalidAAAARecord = errors.New("invalid AAAA record") )
View Source
var (
BaseURL = "https://dns.hetzner.com/api/v1"
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithTimeout ¶
Return a new Client with specified timeout.
func (*Client) CreateRecord ¶
func (c *Client) CreateRecord(name string, ttl int, t string, value string, zone string) (Record, error)
CreateRecord creates a new record. Valid t types are: "A", "AAAA", "NS", "MX", "CNAME", "RP", "TXT", "SOA", "HINFO", "SRV", "DANE", "TLSA", "DS" and "CAA".
func (*Client) DeleteRecord ¶
DeleteRecord deletes a record with id id.
func (*Client) GetAllRecords ¶
GetAllRecords returns all records associated with user.
func (*Client) GetAllRecordsByZone ¶
GetAllRecordsByZone returns all records associated with user from zone zone.
func (*Client) GetAllZones ¶
GetAllZones returns every zones associated with the user.
type Meta ¶
type Meta struct {
Pagination Pagination `json:"pagination"`
}
type Pagination ¶
type TXTVerification ¶
type Zone ¶
type Zone struct { ID string `json:"id"` Created string `json:"created"` Modified string `json:"modified"` LegacyDNSHost string `json:"legacy_dns_host"` LegacyNS []string `json:"legacy_ns"` Name string `json:"name"` NS []string `json:"ns"` Owner string `json:"owner"` Paused bool `json:"paused"` Permission string `json:"permission"` Project string `json:"project"` Registrar string `json:"registrar"` Status string `json:"status"` TTL int `json:"ttl"` Verified string `json:"verified"` RecordsCount int `json:"records_count"` IsSecondaryDNS bool `json:"is_secondary_dns"` TXTVerification TXTVerification `json:"txt_verification"` }
Click to show internal directories.
Click to hide internal directories.