Documentation
¶
Index ¶
- Constants
- type BaseURL
- type Client
- func (c *Client) CreateDomain(domainName string) (Domain, error)
- func (c *Client) CreateRecord(domainId int, record Record) (Record, error)
- func (c *Client) CreateRecords(domainId int, records []Record) ([]Record, error)
- func (c *Client) DeleteAllRecords(domainID int) error
- func (c *Client) DeleteDomain(domainID int) error
- func (c *Client) DeleteRecords(domainId int, recordIds []int) ([]int, error)
- func (c *Client) EnumerateDomains() (map[string]int, error)
- func (c *Client) EnumerateRecords(domainId int) ([]Record, error)
- func (c *Client) GetDomain(domainID int) (Domain, error)
- func (c *Client) IdForDomain(domain string) (int, error)
- func (c *Client) UpdateRecords(domainId int, records []Record) ([]Record, error)
- type Domain
- type DomainsResp
- type Record
- type RecordsResp
Constants ¶
View Source
const ( DNSManagedPath string = "/dns/managed/" DNSRecordsPath string = "{domainId}/records" DNSRecordPath string = "{domainId}/records/{recordId}" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { APIKey string SecretKey string BaseURL BaseURL // contains filtered or unexported fields }
func (*Client) CreateDomain ¶ added in v1.0.0
Creates a new domain
func (*Client) CreateRecord ¶ added in v0.1.2
Creates a single record in the supplied domain
func (*Client) CreateRecords ¶ added in v0.1.2
Create many records at once in the supplied domain
NOTE: is transactional; an error in creating any record causes none to be created
func (*Client) DeleteAllRecords ¶ added in v1.0.0
Deletes all records for the supplied domain
func (*Client) DeleteDomain ¶ added in v1.0.0
Removes a domain and all associated records
func (*Client) DeleteRecords ¶ added in v0.1.2
Deletes records with numerical IDs for the supplied domain
NOTE: will silently continue if a recordId that doesn't belong to the given domainId is passed
func (*Client) EnumerateDomains ¶
Returns a map of Name:ID for all domains managed by the given account
func (*Client) IdForDomain ¶ added in v0.1.2
Finds the numerical ID for a given domain name
type Domain ¶
type Domain struct { ID int `json:"id"` Name string `json:"name"` CreatedAt int `json:"created"` UpdatedAt int `json:"updated"` FolderID int `json:"folderId"` ProcessMulti bool `json:"processMulti"` ActiveThirdParties []string `json:"activeThirdParties"` GtdEnabled bool `json:"gtdEnabled"` // Identifies which action is currently pending // Values: // 0 - nothing pending // 1 - pending creation (usable but not fully created throughout the system) // 3 - pending deletion PendingActionID int `json:"pendingActionId"` }
type DomainsResp ¶
type Record ¶
type Record struct { // A unique name per record Type Name string `json:"name"` // A unique identifier for this record ID int `json:"id,omitempty"` // Can be one of: A, AAAA, ANAME, CNAME, HTTPRED, MX // NS, PTR, SRV, TXT, SPF, or SOA Type string `json:"type"` // Differs per record type Value string `json:"value"` // 1 if the record is the record is domain specific // 0 if the record is part of a template Source int `json:"source,omitempty"` // The time to live of the record Ttl int `json:"ttl"` // Global Traffic Director location. // Values: DEFAULT, US_EAST, US_WEST, EUROPE, // ASIA_PAC, OCREANIA, SOUTH_AMERICA GtdLocation string `json:"gtdLocation"` // The domain ID of this record SourceId int `json:"sourceId,omitempty"` // Indicates if DNS Failover is enabled for an A record Failover bool `json:"failover,omitempty"` // Indicates if System Monitoring is enabled for an A record Monitor bool `json:"monitor,omitempty"` // For HTTP Redirection Records HardLink bool `json:"hardLink,omitempty"` // Indicates if the record has dynamic DNS enabled DynamicDns bool `json:"dynamicDns,omitempty"` // Indicates if an A record is in failed status Failed bool `json:"failed,omitempty"` // The priority for an MX record MxLevel int `json:"mxLevel,omitempty"` // The priority for an SRV record Priority int `json:"priority,omitempty"` // The weight for an SRV record Weight int `json:"weight,omitempty"` // The port for an SRV record Port int `json:"port,omitempty"` }
Click to show internal directories.
Click to hide internal directories.