record

package
Version: v0.0.0-...-58d3d42 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: MIT Imports: 3 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// A is the type of record that hold a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host
	A = "A"
	// AAAA is the type of record that hold a Returns a 128-bit IPv6 address, most commonly used to map hostnames to an IP address of the host
	AAAA = "AAAA"
	// CAA is the type of record that hold the DNS Certification Authority Authorization, constraining acceptable CAs for a host/domain
	CAA = "CAA"
	// CDS is the type of record that hold the child copy of DS record, for transfer to parent
	CDS = "CDS"
	// CNAME is the type of record that hold the alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name
	CNAME = "CNAME"
	// DNAME is the type of record that hold the alias for a name and all its subnames, unlike CNAME, which is an alias for only the exact name.
	// Like a CNAME record, the DNS lookup will continue by retrying the lookup with the new name
	DNAME = "DNAME"
	// DS is the type of record that hold the record used to identify the DNSSEC signing key of a delegated zone
	DS = "DS"
	// LOC is the type of record that specifies a geographical location associated with a domain name
	LOC = "LOC"
	// MX is the type of record that maps a domain name to a list of message transfer agents for that domain
	MX = "MX"
	// NS is the type of record that delegates a DNS zone to use the given authoritative name servers
	NS = "NS"
	// PTR is the type of record that hold a pointer to a canonical name. Unlike a CNAME, DNS processing stops and just the name is returned.
	// The most common use is for implementing reverse DNS lookups, but other uses include such things as DNS-SD.
	PTR = "PTR"
	// SPF (99) (from RFC 4408) was specified as part of the Sender Policy Framework protocol as an alternative to storing SPF data in TXT records,
	// using the same format. It was later found that the majority of SPF deployments lack proper support for this record type, and support for it was discontinued in RFC 7208
	SPF = "SPF"
	// SRV is the type of record that hold the generalized service location record, used for newer protocols instead of creating protocol-specific records such as MX.
	SRV = "SRV"
	// SSHFP is the type of record that hold resource record for publishing SSH public host key fingerprints in the DNS System,
	// in order to aid in verifying the authenticity of the host. RFC 6594 defines ECC SSH keys and SHA-256 hashes
	SSHFP = "SSHFP"
	// TLSA is the type of record that hold a record for DANE.
	// record for DANE. RFC 6698 defines "The TLSA DNS resource record is used to associate a TLS server
	// certificate or public key with the domain name where the record is found, thus forming a 'TLSA certificate association'".
	TLSA = "TLSA"
	// TXT is the type of record that hold human readable text.
	// Since the early 1990s, however, this record more often carries machine-readable data,
	// such as specified by RFC 1464, opportunistic encryption, Sender Policy Framework, DKIM, DMARC, DNS-SD, etc.
	TXT = "TXT"
	// WKS is the type of record that describe well-known services supported by a host. Not used in practice.
	// The current recommendation and practice is to determine whether a service is supported on an IP address by trying to connect to it.
	// SMTP is even prohibited from using WKS records in MX processing
	WKS = "WKS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator interface {
	// Create creates a new record entry
	// possible calls are:
	// Create(recordInfo)
	// Create(recordInfo, "entry")
	// Create(recordInfo, "entry", "type")
	// where "entry" matches entry.example.com
	// and "type" is the record type (A, CNAME, ...)
	Create(recordInfo Info, args ...string) (status *Status, err error)
}

Creator is an interface to create new record entries

type Deleter

type Deleter interface {
	// Delete creates a new record entry
	// possible calls are:
	// Delete(recordInfo)
	// Delete(recordInfo, "entry")
	// Delete(recordInfo, "entry", "type")
	// where "entry" matches entry.example.com
	// and "type" is the record type (A, CNAME, ...)
	Delete(args ...string) (err error)
}

Deleter is an interface to delete existing record entries

type Info

type Info struct {
	// Href contains the API URL to get the record informations
	Href string `json:"rrset_href,omitempty"`
	// Name contains name of the subdomain for this record
	Name string `json:"rrset_name,omitempty"`
	// TTL contains the life time of the record.
	TTL int64 `json:"rrset_ttl,omitempty"`
	// Type contains the DNS record type
	Type string `json:"rrset_type,omitempty"`
	// Values contains the DNS values resolved by the record
	Values []string `json:"rrset_values,omitempty"`
}

Info holds the record informations for a single record entry

type Lister

type Lister interface {
	// List creates a new record entry
	// possible calls are:
	// List(recordInfo)
	// List(recordInfo, "entry")
	// List(recordInfo, "entry", "type")
	// where "entry" matches entry.example.com
	// and "type" is the record type (A, CNAME, ...)
	List(args ...string) (list []*Info, err error)
}

Lister is an interface to list existing record entries

type Manager

type Manager interface {
	Creator
	Updater
	Lister
	Deleter
}

Manager is an interface to manage records (for a zone or domain)

type Record

type Record struct {
	*client.Client
	Prefix string
}

Record holds the zone client structure

func New

func New(c *client.Client, prefix string) *Record

New instanciates a new instance of a Zone client

func (*Record) Create

func (r *Record) Create(recordInfo Info, args ...string) (status *Status, err error)

Create creates a new record entry possible calls are: Create(recordInfo) Create(recordInfo, "entry") Create(recordInfo, "entry", "type") where "entry" matches entry.example.com and "type" is the record type (A, CNAME, ...)

func (*Record) Delete

func (r *Record) Delete(args ...string) (err error)

Delete creates a new record entry possible calls are: Delete(recordInfo) Delete(recordInfo, "entry") Delete(recordInfo, "entry", "type") where "entry" matches entry.example.com and "type" is the record type (A, CNAME, ...)

func (*Record) List

func (r *Record) List(args ...string) (list []*Info, err error)

List creates a new record entry possible calls are: List(recordInfo) List(recordInfo, "entry") List(recordInfo, "entry", "type") where "entry" matches entry.example.com and "type" is the record type (A, CNAME, ...)

func (*Record) Update

func (r *Record) Update(recordInfo Info, args ...string) (status *Status, err error)

Update creates a new record entry possible calls are: Update(recordInfo) Update(recordInfo, "entry") Update(recordInfo, "entry", "type") where "entry" matches entry.example.com and "type" is the record type (A, CNAME, ...)

type Status

type Status struct {
	// Message is the status message returned by the gandi api
	Message string `json:"message"`
}

Status holds the data returned by the API in case of record creation or update

type Updater

type Updater interface {
	// Update creates a new record entry
	// possible calls are:
	// Update(recordInfo)
	// Update(recordInfo, "entry")
	// Update(recordInfo, "entry", "type")
	// where "entry" matches entry.example.com
	// and "type" is the record type (A, CNAME, ...)
	Update(recordInfo Info, args ...string) (status *Status, err error)
}

Updater is an interface to update existing record entries

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL