Documentation ¶
Overview ¶
Package api provides a basic interface for dealing with Name.com DNS API's.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API Contains details required to access the Name.com API.
func NewAPIFromConfig ¶
NewAPIFromConfig constructs a new Name.com API from a configuration.
func NewNameAPI ¶
NewNameAPI constructs a new Name.com API. If dev is true, then the API uses the development API, instead of the production API.
func (API) CreateDNSRecord ¶
CreateDNSRecord creates a DNS record for a given domain. The name field in DNSRecord is in the format [hostname].[domainname]
func (API) DeleteDNSRecord ¶
DeleteDNSRecord deletes a DNS record for a given domain. The recordID can be retreived from GetDNSRecords.
type Config ¶
type Config struct { Dev bool `json:"dev"` Domain string `json:"domain"` Hostnames []string `json:"hostnames"` Interval int `json:"interval"` Token string `json:"token"` Username string `json:"username"` }
Config represents the configuration for a specific domain. Each domain can have multiple hostnames, including the root domain, where hostname is an empty string.
The interval is the polling time (in seconds) for daemon mode.
func LoadConfigs ¶
LoadConfigs loads configurations from a file. The configuration is stored as an array of JSON serialized Config structs.