Documentation
¶
Overview ¶
Package connbyte implements a DNS record management client compatible with the libdns interfaces for ConnByte (https://connbyte.com/).
It uses the ConnByte DNS API (https://api.connbyte.com/) with a bearer token.
Supported record types are the ones accepted by the ConnByte API: A, AAAA, CNAME, MX, NS, SRV and TXT.
The ConnByte API has no batch operations, so SetRecords and DeleteRecords are not atomic. If an error occurs part way, some changes may already be applied.
Index ¶
- type APIError
- 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 {
// APIToken is the ConnByte API token (required).
APIToken string `json:"api_token,omitempty"`
// BaseURL overrides the API endpoint. Optional, defaults to https://api.connbyte.com.
BaseURL string `json:"base_url,omitempty"`
// HTTPClient is used for API calls. Optional.
HTTPClient *http.Client `json:"-"`
// contains filtered or unexported fields
}
Provider facilitates DNS record manipulation with ConnByte.
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 specified records from the zone. It returns the records that were deleted. Type, TTL and value may be left empty to match any value. Records that do not exist are ignored.
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 sets the records in the zone, either by updating existing records or creating new ones. For every (name, type) pair in the input, existing records that are not in the input are deleted. It returns the records that were set (kept or created). This operation is not atomic.