Documentation
¶
Index ¶
- func NewHTTPClient() *http.Client
- func RemoveTrailingDot(input string) string
- type DNSRecord
- type DNSRecordAPIResponse
- type DNSRecordsAPIResponse
- type DeletionAPIResponse
- 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) DoRequest(ctx context.Context, method, url string, body interface{}, ...) error
- func (p *Provider) FromLibDNSRecord(record libdns.Record) (interface{}, 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)
- func (p *Provider) ToLibDNSRecord(r DNSRecord) libdns.Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
NewHTTPClient returns a configured HTTP client.
func RemoveTrailingDot ¶
Types ¶
type DNSRecord ¶
type DNSRecord struct {
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
FullName string `json:"full_name"`
TTL int `json:"ttl"`
Priority uint `json:"priority"`
Content string `json:"content"`
}
DNSRecord represents a DNS record in the API response.
type DNSRecordAPIResponse ¶
type DNSRecordAPIResponse struct {
DNSRecord DNSRecord `json:"dns_record"`
}
DNSRecordAPIResponse represents an API response for a DNS record.
type DNSRecordsAPIResponse ¶
type DNSRecordsAPIResponse struct {
DNSRecords []DNSRecord `json:"dns_records"`
}
DNSRecordsAPIResponse represents an API response of DNS records.
type DeletionAPIResponse ¶
type DeletionAPIResponse struct {
Deleted bool `json:"deleted"`
}
DeletionAPIResponse represents an API response for a deletion.
type Provider ¶
type Provider struct {
APIToken string `json:"api_token,omitempty"`
}
Provider facilitates DNS record manipulation with Katapult.
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) DoRequest ¶
func (p *Provider) DoRequest(ctx context.Context, method, url string, body interface{}, response interface{}) error
DoRequest performs an HTTP request and decodes the response.
func (*Provider) FromLibDNSRecord ¶
FromLibDNSRecord converts a libdns.Record to an API request body.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.