Documentation
¶
Overview ¶
Helper functions for record conversion
Index ¶
- func HasRecord(name, rrType string, records []libdns.Record) bool
- func HasWWWInclude(zone sdk.ZoneItem) bool
- func MatchesZoneRecord(target, zr sdk.ZoneRecord) bool
- func ToAutoDNS(record libdns.Record) (sdk.ZoneRecord, error)
- func ToLibDNS(zr sdk.ZoneRecord) (libdns.Record, error)
- 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 ¶
func HasWWWInclude ¶
func MatchesZoneRecord ¶
func MatchesZoneRecord(target, zr sdk.ZoneRecord) bool
MatchesZoneRecord reports whether zr matches target using libdns's wildcard rules: Name must match exactly; empty Type/TTL/Value in target act as wildcards.
Types ¶
type Provider ¶
type Provider struct {
Client *sdk.SDK
// Optional fields to skip zone lookup if already known
Zone *string `json:"origin,omitempty"`
Nameserver *string `json:"nameserver,omitempty"`
}
Provider facilitates DNS record manipulation with AutoDNS.
func NewWithDefaults ¶
NewWithDefaults is a convenience method to create the provider with sensible defaults.
func NewWithSDK ¶
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. Per the libdns contract, records that don't exist are silently ignored, matching is exact on Name+Type+TTL+Value, and empty Type/TTL/Value act as wildcards.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.