Documentation ¶
Overview ¶
Package dns is for our 3rd party DNS integrations
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DNSOptions config.DNS
DNSOptions holds the various options from the main config we might want to use, this does mean these values are in multiple places, which is odd but they dont' change execpt on restart (today)
Functions ¶
This section is empty.
Types ¶
type AmazonDNS ¶
type AmazonDNS struct { CredsFile string // the shared credentials filename (full path) Profile string // profile within the creds file to use, "" for default ZoneID string // the Route 53 DNS zone we are using }
AmazonDNS stores all the options we need to talk to Route 53
func NewAmazonDNS ¶
NewAmazonDNS will return our Amazon Route 53 DNS interface
func (*AmazonDNS) GetARecord ¶
GetARecord returns an A record for our host. If the host already has one, this will return the first record encountered, it does not currently ensure that record is in the network we are asking for. If there is no existing record, it will loop over a 3 dimensional array looking for a free entry to use.
func (*AmazonDNS) ListARecords ¶
func (a *AmazonDNS) ListARecords() ([]RecordList, error)
ListARecords repopulates the internal cache and then appends any A records it finds to a / RecordList array and returns that
func (*AmazonDNS) RemoveARecord ¶
RemoveARecord passes our name to deleteARecord as it doesn't have to do any additional processing
type DNS ¶
type DNS interface { GetARecord(name string, networkBlocks []string) (string, error) // returns a string representation of an IPv4 address RemoveARecord(name string) error // removes the record from our 3rd party ListARecords() ([]RecordList, error) // returns a list of all the A records }
The DNS interface provides the list of functions all our 3rd party integrations should support. I don't like that I coded the record type in the name, but until I decide I need IPv6, etc its good enough
type GoogleDNS ¶
type GoogleDNS struct { Creds []byte // the contents of our service account json credentials file Project string // the GCP project name we are operating on Zone string // the GCP DNS zone we are using }
GoogleDNS stores all the options we need to talk to GCP
func NewGoogleDNS ¶
NewGoogleDNS will return our GCP DNS interface The creds, project, and zone here are actually in the options as well, but they are important enough to warrant being "top level" items
func (*GoogleDNS) GetARecord ¶
GetARecord returns an A record for our host. If the host already has one, this will return the first record encountered, it does not currently ensure that record is in the network we are asking for. If there is no existing record, it will loop over a 3 dimensional array looking for a free entry to use.
func (*GoogleDNS) ListARecords ¶
func (g *GoogleDNS) ListARecords() ([]RecordList, error)
ListARecords repopulates the internal cache and then appends any A records it finds to a / RecordList array and returns that
func (*GoogleDNS) RemoveARecord ¶
RemoveARecord passes our name to deleteARecord as it doesn't have to do any additional processing
type RecordList ¶
type RecordList struct { Name string // the name of the entry RecordSet []string // the values in the entry }
RecordList is a simple look at DNS records used as a common return for our interface