Documentation
¶
Overview ¶
Package porkbun implements a DNS record management client compatible with the libdns interfaces for Porkbun.
Index ¶
- Constants
- func LibdnsZoneToPorkbunDomain(zone string) string
- func MakeApiRequest[T any](endpoint string, body io.Reader, responseType T) (T, error)
- type ApiCredentials
- type Provider
- func (p *Provider) AppendRecords(_ context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) CheckCredentials(_ context.Context) (string, error)
- func (p *Provider) DeleteRecords(_ context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(_ context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
Constants ¶
View Source
const ApiBase = "https://api.porkbun.com/api/json/v3"
Variables ¶
This section is empty.
Functions ¶
func LibdnsZoneToPorkbunDomain ¶ added in v0.1.2
LibdnsZoneToPorkbunDomain Strips the trailing dot from a Zone
Types ¶
type ApiCredentials ¶
type Provider ¶
type Provider struct { APIKey string `json:"api_key,omitempty"` APISecretKey string `json:"api_secret_key,omitempty"` }
Provider facilitates DNS record manipulation with Porkbun.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(_ 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) CheckCredentials ¶
CheckCredentials allows verifying credentials work in test scripts
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(_ context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the records from the zone. It returns the records that were deleted.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
Click to show internal directories.
Click to hide internal directories.