Documentation ¶
Index ¶
- Constants
- type Body
- type Client
- func (c *Client) CreateRecord(domainID string, cr map[string]interface{}) (string, error)
- func (c *Client) DeleteRecord(domainID string, recordID string) error
- func (c *Client) NewRequest(method, path string, body *bytes.Buffer, requestDate string) (*http.Request, error)
- func (c *Client) ReadRecord(domainID string, recordID string) (*Record, error)
- func (c *Client) UpdateRecord(domainID string, recordID string, cr map[string]interface{}) (string, error)
- type DataResponse
- type Error
- type Record
Constants ¶
const SandboxURL = "http://api.sandbox.dnsmadeeasy.com/V2.0"
SandboxURL is the URL of the DNS Made Easy Sandbox
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // API Key AKey string // Secret Key SKey string // URL to the API to use URL string // HttpClient is the client to use. Default will be // used if not provided. HTTP *http.Client }
Client provides a client to the dnsmadeeasy API
func NewClient ¶
NewClient returns a new dnsmadeeasy client. It requires an API key and secret key. You can generate them by visiting the Config, Account Information section of the dnsmadeeasy control panel for your account.
func (*Client) CreateRecord ¶
CreateRecord creates a DNS record on DNSMadeEasy
func (*Client) DeleteRecord ¶
DeleteRecord destroys a record by the ID specified and returns an error if it fails. If no error is returned, the Record was succesfully destroyed.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, path string, body *bytes.Buffer, requestDate string) (*http.Request, error)
NewRequest creates a new request with the params
func (*Client) ReadRecord ¶
ReadRecord gets a record by the ID specified and returns a Record and an error.
type DataResponse ¶
type DataResponse struct {
Data []Record `json:"data"`
}
DataResponse is the response from a GET ie all records for a domainID
type Error ¶
type Error struct {
Errors []string `json:"error"`
}
Error is the error format that they return to us if there is a problem
type Record ¶
type Record struct { Name string `json:"name"` Value string `json:"value"` RecordID int64 `json:"id"` Type string `json:"type"` Source int64 `json:"source"` SourceID int64 `json:"sourceId"` DynamicDNS bool `json:"dynamicDns"` Password string `json:"password"` TTL int64 `json:"ttl"` Monitor bool `json:"monitor"` Failover bool `json:"failover"` Failed bool `json:"failed"` GtdLocation string `json:"gtdLocation"` Description string `json:"description"` Keywords string `json:"keywords"` Title string `json:"title"` HardLink bool `json:"hardLink"` MXLevel int64 `json:"mxLevel"` Weight int64 `json:"weight"` Priority int64 `json:"priority"` Port int64 `json:"port"` RedirectType string `json:"redirectType"` }
Record is used to represent a retrieved Record.
func (*Record) StringRecordID ¶
StringRecordID returns the record id as a string.