cnr

package
v4.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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

func (n *Client) EnsureZoneExists(domain string, metadata map[string]string) error

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

func (n *Client) GetAPIError(format string, objectid string, r *response.Response) error

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

func (n *Client) GetZoneRecords(domain string, meta map[string]string) (models.Records, error)

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.

func (*Client) ListZones added in v4.15.5

func (n *Client) ListZones() ([]string, error)

ListZones lists all the

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL