Documentation
¶
Overview ¶
Package dynu implements a DNS record management client compatible with the libdns interfaces for dynu.
Index ¶
- type APIException
- type Client
- func (c *Client) AddRecord(ctx context.Context, hostnameId int64, record DNSRecord) (*DNSRecord, error)
- func (c *Client) DeleteRecord(ctx context.Context, hostnameId int64, dnsRecordId string) error
- func (c *Client) DeleteRecords(ctx context.Context, hostnameId int64, rrType string, nodeName string, ...) error
- func (c *Client) GetRecords(ctx context.Context, hostnameId int64) ([]DNSRecord, error)
- func (c *Client) GetRootDomain(ctx context.Context, hostname string) (*DNSHostname, error)
- type DNSHostname
- type DNSRecord
- type DeleteResponse
- type DynuProviderData
- 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) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- type RecordsResponse
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIException ¶
type APIException struct {
StatusCode int32 `json:"statusCode,omitempty"`
Type string `json:"type,omitempty"`
Message string `json:"message,omitempty"`
}
func (APIException) Error ¶
func (a APIException) Error() string
type Client ¶
type Client struct {
HTTPClient *http.Client
APIToken string
// contains filtered or unexported fields
}
func (*Client) DeleteRecord ¶
func (*Client) DeleteRecords ¶ added in v1.0.0
func (*Client) GetRecords ¶
func (*Client) GetRootDomain ¶
type DNSHostname ¶
type DNSRecord ¶
type DNSRecord struct {
ID int64 `json:"id,omitempty"`
Type string `json:"recordType,omitempty"`
DomainID int64 `json:"domainId,omitempty"`
DomainName string `json:"domainName,omitempty"`
NodeName string `json:"nodeName,omitempty"`
Hostname string `json:"hostname,omitempty"`
State bool `json:"state,omitempty"`
Content string `json:"content,omitempty"`
Ipv4Address string `json:"ipv4Address,omitempty"`
Ipv6Address string `json:"ipv6Address,omitempty"`
Host string `json:"host,omitempty"`
TextData string `json:"textData,omitempty"`
TTL int `json:"ttl,omitempty"`
Priority int `json:"priority,omitempty"`
Flags int `json:"flags,omitempty"`
Tag string `json:"tag,omitempty"`
Value string `json:"value,omitempty"`
Weight int `json:"weight,omitempty"`
Port int `json:"port,omitempty"`
StatusCode int32 `json:"statusCode,omitempty"`
}
type DeleteResponse ¶
type DeleteResponse struct {
StatusCode int32 `json:"statusCode,omitempty"`
}
type DynuProviderData ¶ added in v1.0.0
type Provider ¶
type Provider struct {
// config fields (with snake_case json struct tags on exported fields)
APIToken string `json:"api_token,omitempty"`
OwnDomain string `json:"own_domain,omitempty"`
Once sync.Once
Client *Client
}
Provider facilitates DNS record manipulation with dynu.
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 records from the zone. It returns the records that were deleted.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
type RecordsResponse ¶
type UpdateResponse ¶
Click to show internal directories.
Click to hide internal directories.