Documentation
¶
Overview ¶
Package httpnet implements a libdns provider for the http.net DNS API.
Authentication uses an API token from the http.net partner portal. Write operations may return a "pending" status; the package handles this by falling back to a follow-up read to retrieve assigned record IDs.
Index ¶
- 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) ListZones(ctx context.Context) ([]libdns.Zone, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// AuthToken is the http.net API authentication token.
AuthToken string `json:"auth_token,omitempty"`
// BaseURL optionally overrides the default API base URL. Useful for tests.
BaseURL string `json:"base_url,omitempty"`
// HTTPClient optionally overrides the default HTTP client.
HTTPClient *http.Client `json:"-"`
// contains filtered or unexported fields
}
Provider implements the libdns DNS provider interfaces for http.net.
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 records from the zone. Matching rules (per libdns v1):
- If a record's RR has both Name and non-empty Data, delete the record whose (name, type, content) matches exactly.
- If a record's RR has Name and Type but empty Data, delete the entire RRset at that name and type.
Returns the records that were deleted.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
func (*Provider) SetRecords ¶
func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
SetRecords replaces the RRset (all records sharing the same name and type) for each (name, type) present in records. Existing records at those RRsets that are not in the input are deleted. Other RRsets in the zone are untouched.