Documentation
¶
Overview ¶
Package thelittlehost implements a DNS record management client compatible with the libdns interfaces for The Little Host DNS API.
Index ¶
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []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, recs []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 {
// APIToken is the bearer token for authentication with The Little Host API.
// Tokens are prefixed with "tlh_" and can be generated in the control panel.
APIToken string `json:"api_token,omitempty"`
// contains filtered or unexported fields
}
Provider facilitates DNS record manipulation with The Little Host.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone without replacing any existing records. It returns the records that were added. Record names must be relative to the zone.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the specified records from the zone. Records that don't exist in the zone are silently ignored. Empty Type, TTL, or Data fields in the input act as wildcards.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone. zone must be a fully-qualified domain name with a trailing dot (e.g. "example.com."). Record names in the returned slice are relative to the zone.
func (*Provider) SetRecords ¶
func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
SetRecords sets the records in the zone, either by updating existing records or creating new ones. For each (name, type) pair present in recs, it ensures the zone contains exactly those records — surplus existing records for that pair are deleted. Records for (name, type) pairs not mentioned in recs are left untouched. It returns the records that were set.