Documentation
¶
Overview ¶
Package dinahosting implements a DNS record management client compatible with the libdns interfaces for Dinahosting (https://es.dinahosting.com/api).
This package supports the following record types for writes (Append, Set, Delete): A, AAAA, TXT and CNAME. GetRecords additionally returns any other record types present in the zone as opaque libdns.RR values.
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) 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 {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
// HTTPClient, if non-nil, is used to perform requests to the Dinahosting
// API. When nil, an internal client with a generous per-request timeout
// is used. Callers that need a custom transport, proxy, TLS config or
// their own retry/observability layer can inject their own client here.
HTTPClient *http.Client `json:"-"`
}
Provider facilitates DNS record manipulation with Dinahosting.
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 as concrete libdns RR-type structs (A/AAAA as libdns.Address, TXT as libdns.TXT, CNAME as libdns.CNAME).
Supported record types: A, AAAA, TXT, CNAME.
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 as concrete libdns RR-type structs.
Supported record types: A, AAAA, TXT, CNAME.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
A and AAAA records are returned as libdns.Address, TXT as libdns.TXT, CNAME as libdns.CNAME. Any other record type is returned as an opaque libdns.RR so callers can still enumerate what exists in the zone.
func (*Provider) SetRecords ¶
func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
SetRecords updates the zone so that the RRset formed by each input record's (Name, Type) pair contains exactly the input records. It implements the canonical semantics described in the godoc of libdns.RecordSetter: existing records in the same RRset are deleted first, then the new records are appended.