Documentation ¶
Overview ¶
Package easydns implements a DNS record management client compatible with the libdns interfaces for EasyDNS. See https://cp.easydns.com/manage/security/ to manage Token and Key information for your account.
Index ¶
- type AddEntry
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- type UpdateEntry
- type ZoneRecordResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddEntry ¶
type AddEntry struct { Domain string `json:"domain,omitempty"` Host string `json:"host,omitempty"` TTL int `json:"ttl,omitempty"` Priority int `json:"prio,omitempty"` Type string `json:"type,omitempty"` Rdata string `json:"rdata,omitempty"` }
AddEntry is the request body for adding a record to a zone (PUT request)
type Provider ¶
type Provider struct { // EasyDNS API Token (required) APIToken string `json:"api_token,omitempty"` // EasyDNS API Key (required) APIKey string `json:"api_key,omitempty"` // EasyDNS API URL (defaults to https://rest.easydns.net) APIUrl string `json:"api_url,omitempty"` }
Provider facilitates DNS record manipulation with EasyDNS.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone. It returns the records that were added.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the records from the zone. It returns the records that were deleted.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
type UpdateEntry ¶
type UpdateEntry struct { Host string `json:"host,omitempty"` TTL int `json:"ttl,omitempty"` Type string `json:"type,omitempty"` Rdata string `json:"rdata,omitempty"` }
UpdateEntry is the request body for updating a record in a zone (POST request)
type ZoneRecordResponse ¶
type ZoneRecordResponse struct { Timestamp int `json:"tm,omitempty"` // Result Timestamp Data []struct { Id string `json:"id,omitempty"` Domain string `json:"domain,omitempty"` Host string `json:"host,omitempty"` TTL string `json:"ttl,omitempty"` Priority string `json:"prio,omitempty"` Type string `json:"type,omitempty"` Rdata string `json:"rdata,omitempty"` LastModified string `json:"last_mod,omitempty"` } `json:"data,omitempty"` Count int `json:"count,omitempty"` Total int `json:"total,omitempty"` Start int `json:"start,omitempty"` Max int `json:"max,omitempty"` Status int `json:"status,omitempty"` }
ZoneRecordResponse is the response from the EasyDNS API for a zone record request.