Documentation ¶
Index ¶
- func PerformHttpRequest(method string, url string, username string, password string, body io.Reader, ...) (int, []byte, error)
- type Client
- type CloudFlareClient
- type DnsRecord
- type DnsRecordUpdateResponse
- type DuckDNSClient
- type GoDaddyClient
- type IDynamicDnsClient
- type ListDnsRecordsResponse
- type NamecheapClient
- type NamecheapXmlResponse
- type NoIPClient
- type ZonesJsonResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
ServiceConfig *config.ServiceConfiguration
}
func (Client) LogIPAddressUpdate ¶
LogIPAddressUpdate logs the dynamic dns client IP address update
type CloudFlareClient ¶
type CloudFlareClient Client
CloudFlareClient implements the cloudflare dynamic dns client
cloudflare docs:
https://api.cloudflare.com/#getting-started-resource-ids https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record
func (CloudFlareClient) UpdateIPAddresses ¶
func (client CloudFlareClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error
UpdateIPAddresses performs the dynamic dns IP address update operation
type DnsRecordUpdateResponse ¶
type DnsRecordUpdateResponse struct {
Success bool `json:"success"`
}
type DuckDNSClient ¶
type DuckDNSClient Client
DuckDNSClient implements the duckdns dynamic dns client
duckdns docs: https://www.duckdns.org/spec.jsp
sample response: OK
func (DuckDNSClient) UpdateIPAddresses ¶
func (client DuckDNSClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error
UpdateIPAddresses performs the dynamic dns IP address update operation
type GoDaddyClient ¶
type GoDaddyClient Client
GoDaddyClient implements the godaddy dynamic dns client
godaddy docs: https://developer.godaddy.com/doc/endpoint/domains#/v1/recordReplaceTypeName
request urls:
https://api.ote-godaddy.com/v1/domains/example.com/records/A/recordName https://api.godaddy.com/v1/domains/example.com/records/A/recordName
curl:
curl -X PUT "https://api.ote-godaddy.com/v1/domains/example.com/records/A/recordName" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: sso-key UzQxLikm_46KxDFnbjN7cQjmw6wocia:46L26ydpkwMaKZV6uVdDWe" -d "[ { \"data\": \"127.0.0.1\", \"port\": 53, \"priority\": 0, \"protocol\": \"string\", \"service\": \"string\", \"ttl\": 600, \"weight\": 0 }]"
sample response:
{ "code": "ACCESS_DENIED", "message": "Authenticated user is not allowed access" }
func (GoDaddyClient) UpdateIPAddresses ¶
func (client GoDaddyClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error
UpdateIPAddresses performs the dynamic dns IP address update operation
type IDynamicDnsClient ¶
type IDynamicDnsClient interface { // UpdateIPAddresses performs the dynamic dns IP address update operation UpdateIPAddresses(ipv4, ipv6 net.IP) error }
IDynamicDnsClient describes the interface of a type that knows how to perform a dynamic dns IP address update
type ListDnsRecordsResponse ¶
type NamecheapClient ¶
type NamecheapClient Client
NamecheapClient implements the namecheap dynamic dns client
namecheap docs: https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-do-i-use-a-browser-to-dynamically-update-the-hosts-ip/
request url: https://dynamicdns.park-your-domain.com/update?host=@&domain=example.com&password=PASSWORD&ip=255.255.255.255
sample response xml: <?xml version="1.0"?> <interface-response>
<Command>SETDNSHOST</Command> <Language>eng</Language> <ErrCount>1</ErrCount> <errors> <Err1>Error message here</Err1> </errors> <ResponseCount>1</ResponseCount> <responses> <response> <ResponseNumber>99999</ResponseNumber> <ResponseString>Error message here</ResponseString> </response> </responses> <Done>true</Done> <debug><![CDATA[]]></debug>
</interface-response>
func (NamecheapClient) UpdateIPAddresses ¶
func (client NamecheapClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error
UpdateIPAddresses performs the dynamic dns IP address update operation
type NamecheapXmlResponse ¶
type NamecheapXmlResponse struct { XMLName xml.Name `xml:"interface-response"` Text string `xml:",chardata"` Command string `xml:"Command"` Language string `xml:"Language"` ErrCount int `xml:"ErrCount"` Errors struct { Text string `xml:",chardata"` Err1 string `xml:"Err1"` } `xml:"errors"` ResponseCount string `xml:"ResponseCount"` Responses struct { Text string `xml:",chardata"` Response struct { Text string `xml:",chardata"` ResponseNumber int `xml:"ResponseNumber"` ResponseString string `xml:"ResponseString"` } `xml:"response"` } `xml:"responses"` Done string `xml:"Done"` Debug string `xml:"debug"` }
type NoIPClient ¶
type NoIPClient Client
NoIPClient implements the noip dynamic dns client
noip docs: https://www.noip.com/integrate/request
sample response: nochg 192.0.2.25
func (NoIPClient) UpdateIPAddresses ¶
func (client NoIPClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error
UpdateIPAddresses performs the dynamic dns IP address update operation