Documentation
¶
Index ¶
- type DomainConfig
- 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 DomainConfig ¶
type Provider ¶
type Provider struct { // Provider.Configs defines a map from domain string to // DomainConfig. It uses the same structure as ACME-DNS client // JSON storage file (https://github.com/acme-dns/acme-dns-client). Configs map[string]DomainConfig `json:"config,omitempty"` // ACME-DNS account username as returned by ACME-DNS API /register endpoint. Username string `json:"username,omitempty"` // ACME-DNS account password as returned by ACME-DNS API /register endpoint. Password string `json:"password,omitempty"` // ACME-DNS account subdomain as returned by ACME-DNS API /register endpoint. Subdomain string `json:"subdomain,omitempty"` // ACME-DNS API base URL. For example, https://auth.acme-dns.io ServerURL string `json:"server_url,omitempty"` }
Provider must be set up in one of two ways:
1) Set Configs field. Configs field defines a map from domains to different ACME-DNS accounts.
2) Set fields Username, Password, Subdomain, ServerURL. If these fields are set, one account will be used for AppendRecords for all zones and record names.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
Implements libdns.RecordAppender.
The only operation Joohoi's ACME-DNS API supports is a rolling update of two TXT records.
If Provider Configs field is not nil, zone and record names are used to select relevant credentials from Provider.Configs.
If Configs is nil and Provider is set up with non-nil Username, Password, Subdomain and ServerURL fields, these credentials will be used to update ACME-DNS account TXT records regardless of what zone and record names are passed.
Only TXT records are supported. ID, TTL and Priority fields of libdns.Record are ignored.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
Implements libdns.RecordDeleter.
DeleteRecords does nothing at all - ACME-DNS does not support record deletion. However, older records are automatically deleted as newer records are added (a rolling update of two records).
func (*Provider) GetRecords ¶ added in v0.4.0
Implements libdns.RecordGetter
Since Joohoi's ACME-DNS does not support getting records, this method will always return an error.
func (*Provider) SetRecords ¶ added in v0.4.0
func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
Implements libdns.RecordSetter
The only operation Joohoi's ACME-DNS API supports is a rolling update of two TXT records.
If Provider Configs field is not nil, zone and record names are used to select relevant credentials from Provider.Configs.
If Configs is nil and Provider is set up with non-nil Username, Password, Subdomain and ServerURL fields, these credentials will be used to update ACME-DNS account TXT records regardless of what zone and record names are passed.
Only TXT records are supported. ID, TTL and Priority fields of libdns.Record are ignored.