Documentation
¶
Index ¶
- func AuditRecords(records []*models.RecordConfig) []error
- type Client
- func (n *Client) EnsureZoneExists(domain string, metadata map[string]string) error
- func (n *Client) GetAPIError(format string, objectid string, r *response.Response) error
- func (n *Client) GetNameservers(domain string) ([]*models.Nameserver, error)
- func (n *Client) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)
- func (n *Client) GetZoneRecords(domain string, meta map[string]string) (models.Records, error)
- func (n *Client) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, int, error)
- func (n *Client) ListZones() ([]string, error)
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditRecords ¶
func AuditRecords(records []*models.RecordConfig) []error
AuditRecords returns a list of errors corresponding to the records that aren't supported by this provider. If all records are supported, an empty list is returned.
Types ¶
type Client ¶ added in v4.15.5
type Client struct {
APILogin string
APIPassword string
APIEntity string
// contains filtered or unexported fields
}
Client describes a connection to the CNR API.
func (*Client) EnsureZoneExists ¶ added in v4.15.5
EnsureZoneExists returns an error * if access to dnszone is not allowed (not authorized) or * if it doesn't exist and creating it fails
func (*Client) GetAPIError ¶ added in v4.15.5
GetAPIError returns an error including API error code and error description.
func (*Client) GetNameservers ¶ added in v4.15.5
func (n *Client) GetNameservers(domain string) ([]*models.Nameserver, error)
GetNameservers gets the nameservers set on a domain.
func (*Client) GetRegistrarCorrections ¶ added in v4.15.5
func (n *Client) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)
GetRegistrarCorrections gathers corrections that would being n to match dc.
func (*Client) GetZoneRecords ¶ added in v4.15.5
GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (*Client) GetZoneRecordsCorrections ¶ added in v4.15.5
func (n *Client) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, int, error)
GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
type Record ¶ added in v4.15.5
type Record struct {
// DomainName is the zone that the record belongs to.
DomainName string
// Host is the hostname relative to the zone: e.g. for a record for blog.example.org, domain would be "example.org" and host would be "blog".
// An apex record would be specified by either an empty host "" or "@".
// A SRV record would be specified by "_{service}._{protocol}.{host}": e.g. "_sip._tcp.phone" for _sip._tcp.phone.example.org.
Host string
// FQDN is the Fully Qualified Domain Name. It is the combination of the host and the domain name. It always ends in a ".". FQDN is ignored in CreateRecord, specify via the Host field instead.
Fqdn string
// Type is one of the following: A, AAAA, ANAME, ALIAS, CNAME, MX, NS, SRV, or TXT.
Type string
// Answer is either the IP address for A or AAAA records; the target for ANAME, CNAME, MX, or NS records; the text for TXT records.
// For SRV records, answer has the following format: "{weight} {port} {target}" e.g. "1 5061 sip.example.org".
Answer string
// TTL is the time this record can be cached for in seconds.
TTL uint32
// Priority is only required for MX and SRV records, it is ignored for all others.
Priority uint32
}
Record covers an individual DNS resource record.