Documentation ¶
Overview ¶
Package porkbun contains a client of the DNS API of Porkdun.
Index ¶
- Constants
- type Client
- func (c *Client) CreateRecord(ctx context.Context, domain string, record Record) (int, error)
- func (c *Client) DeleteRecord(ctx context.Context, domain string, id int) error
- func (c *Client) EditRecord(ctx context.Context, domain string, id int, record Record) error
- func (c *Client) Ping(ctx context.Context) (string, error)
- func (c *Client) RetrieveRecords(ctx context.Context, domain string) ([]Record, error)
- func (c *Client) RetrieveSSLBundle(ctx context.Context, domain string) (SSLBundle, error)
- type Record
- type SSLBundle
- type ServerError
- type Status
Constants ¶
View Source
const DefaultTTL = "300"
DefaultTTL The minimum and the default is 300 seconds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL *url.URL HTTPClient *http.Client // contains filtered or unexported fields }
Client an API client for Porkdun.
func (*Client) CreateRecord ¶
CreateRecord creates a DNS record.
name (optional): The subdomain for the record being created, not including the domain itself. Leave blank to create a record on the root domain. Use * to create a wildcard record. type: The type of record being created. Valid types are: A, MX, CNAME, ALIAS, TXT, NS, AAAA, SRV, TLSA, CAA content: The answer content for the record. ttl (optional): The time to live in seconds for the record. The minimum and the default is 300 seconds. prio (optional) The priority of the record for those that support it.
func (*Client) DeleteRecord ¶
DeleteRecord deletes a specific DNS record.
func (*Client) EditRecord ¶
EditRecord edits a DNS record.
name (optional): The subdomain for the record being created, not including the domain itself. Leave blank to create a record on the root domain. Use * to create a wildcard record. type: The type of record being created. Valid types are: A, MX, CNAME, ALIAS, TXT, NS, AAAA, SRV, TLSA, CAA content: The answer content for the record. ttl (optional): The time to live in seconds for the record. The minimum and the default is 300 seconds. prio (optional) The priority of the record for those that support it.
func (*Client) RetrieveRecords ¶
RetrieveRecords retrieve all editable DNS records associated with a domain.
type Record ¶
type Record struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Content string `json:"content,omitempty"` TTL string `json:"ttl,omitempty"` Prio string `json:"prio,omitempty"` Notes string `json:"notes,omitempty"` }
Record a DNS record.
type SSLBundle ¶ added in v0.3.0
type SSLBundle struct { IntermediateCertificate string `json:"intermediatecertificate"` CertificateChain string `json:"certificatechain"` PrivateKey string `json:"privatekey"` PublicKey string `json:"publickey"` }
SSLBundle a SSL certificate bundle.
type ServerError ¶ added in v0.2.0
type ServerError struct { StatusCode int `json:"statusCode"` Message string `json:"message,omitempty"` }
ServerError the API server error.
func (ServerError) Error ¶ added in v0.2.0
func (a ServerError) Error() string
Click to show internal directories.
Click to hide internal directories.