hexonet

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package hexonet implements a registrar that uses the hexonet api to set name servers. It will self register it's providers when imported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HXClient

type HXClient struct {
	APILogin    string
	APIPassword string
	APIEntity   string
	// contains filtered or unexported fields
}

HXClient describes a connection to the hexonet API.

func (*HXClient) EnsureDomainExists

func (n *HXClient) EnsureDomainExists(domain string) error

EnsureDomainExists returns an error * if access to dnszone is not allowed (not authorized) or * if it doesn't exist and creating it fails

func (*HXClient) GetDomainCorrections

func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

GetDomainCorrections gathers correctios that would bring n to match dc.

func (*HXClient) GetHXApiError

func (n *HXClient) GetHXApiError(format string, objectid string, r *lr.ListResponse) error

GetHXApiError returns an error including API error code and error description.

func (*HXClient) GetNameservers

func (n *HXClient) GetNameservers(domain string) ([]*models.Nameserver, error)

GetNameservers gets the nameservers set on a domain.

func (*HXClient) GetRegistrarCorrections

func (n *HXClient) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

GetRegistrarCorrections gathers corrections that would being n to match dc.

type HXRecord

type HXRecord struct {
	// Raw api value of that RR
	Raw string
	// 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}._{protocal}.{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, 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
}

HXRecord covers an individual DNS resource record.

Jump to

Keyboard shortcuts

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