Documentation
¶
Overview ¶
Package netnod provides a Go client for the Netnod Primary DNS API.
Index ¶
- Constants
- type ACMECreateResponse
- type ACMELabel
- type ACMEListResponse
- type Client
- func (c *Client) CreateACME(zoneID, label string) (*ACMECreateResponse, error)
- func (c *Client) CreateDynDNS(zoneID, label string) (*DynDNSCreateResponse, error)
- func (c *Client) CreateZone(zone *Zone) (*Zone, error)
- func (c *Client) CreateZoneFromBIND(zone *ZoneCreateBIND) (*Zone, error)
- func (c *Client) DeleteACME(zoneID, label string) error
- func (c *Client) DeleteDynDNS(zoneID, label string) error
- func (c *Client) DeleteZone(zoneID string) error
- func (c *Client) ExportZone(zoneID string) (string, error)
- func (c *Client) GetRRset(zoneID, name, rrType string) (*RRset, error)
- func (c *Client) GetZone(zoneID string) (*Zone, error)
- func (c *Client) ListACME(zoneID string) ([]ACMELabel, error)
- func (c *Client) ListDynDNS(zoneID string) ([]DynDNSLabel, error)
- func (c *Client) ListZones() ([]Zone, error)
- func (c *Client) NotifyZone(zoneID string) (*NotifyResponse, error)
- func (c *Client) PatchZoneRRsets(zoneID string, rrsets []RRset) error
- func (c *Client) SetHTTPClient(httpClient *http.Client)
- func (c *Client) UpdateZone(zoneID string, zone *Zone) error
- type DynDNSCreateResponse
- type DynDNSLabel
- type DynDNSListResponse
- type ErrorResponse
- type NotifyResponse
- type RRset
- type Record
- type Zone
- type ZoneCreateBIND
- type ZoneListResponse
Constants ¶
const DefaultAPIURL = "https://primarydnsapi.netnod.se"
DefaultAPIURL is the default Netnod Primary DNS API endpoint
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACMECreateResponse ¶
type ACMECreateResponse struct {
Hostname string `json:"hostname"`
ChallengeHostname string `json:"challenge_hostname"`
Token string `json:"token"`
}
ACMECreateResponse represents the response from enabling ACME
type ACMELabel ¶
type ACMELabel struct {
Label string `json:"label"`
Hostname string `json:"hostname"`
ChallengeHostname string `json:"challenge_hostname"`
}
ACMELabel represents an ACME-enabled label
type ACMEListResponse ¶
type ACMEListResponse struct {
Labels []ACMELabel `json:"labels"`
}
ACMEListResponse represents the response from listing ACME labels
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the Netnod Primary DNS API
func (*Client) CreateACME ¶
func (c *Client) CreateACME(zoneID, label string) (*ACMECreateResponse, error)
CreateACME enables ACME DNS-01 challenges for a label in a zone
func (*Client) CreateDynDNS ¶
func (c *Client) CreateDynDNS(zoneID, label string) (*DynDNSCreateResponse, error)
CreateDynDNS enables DynDNS for a label in a zone
func (*Client) CreateZone ¶
CreateZone creates a new zone
func (*Client) CreateZoneFromBIND ¶
func (c *Client) CreateZoneFromBIND(zone *ZoneCreateBIND) (*Zone, error)
CreateZoneFromBIND creates a new zone using BIND zone file format
func (*Client) DeleteACME ¶
DeleteACME disables ACME for a label in a zone
func (*Client) DeleteDynDNS ¶
DeleteDynDNS disables DynDNS for a label in a zone
func (*Client) DeleteZone ¶
DeleteZone deletes a zone
func (*Client) ExportZone ¶
ExportZone exports a zone in BIND zone file format
func (*Client) ListDynDNS ¶
func (c *Client) ListDynDNS(zoneID string) ([]DynDNSLabel, error)
ListDynDNS lists all DynDNS-enabled labels for a zone
func (*Client) ListZones ¶
ListZones returns all zones, automatically paginating through all results.
func (*Client) NotifyZone ¶
func (c *Client) NotifyZone(zoneID string) (*NotifyResponse, error)
NotifyZone triggers an immediate DNS NOTIFY for a zone
func (*Client) PatchZoneRRsets ¶
PatchZoneRRsets updates specific RRsets in a zone
func (*Client) SetHTTPClient ¶
SetHTTPClient allows setting a custom HTTP client (useful for testing)
type DynDNSCreateResponse ¶
DynDNSCreateResponse represents the response from enabling DynDNS
type DynDNSLabel ¶
DynDNSLabel represents a DynDNS-enabled label
type DynDNSListResponse ¶
type DynDNSListResponse struct {
Labels []DynDNSLabel `json:"labels"`
}
DynDNSListResponse represents the response from listing DynDNS labels
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents an API error
type NotifyResponse ¶
type NotifyResponse struct {
Result string `json:"result"`
}
NotifyResponse represents the response from a notify request
type RRset ¶
type RRset struct {
Name string `json:"name"`
Type string `json:"type"`
TTL *int64 `json:"ttl,omitempty"`
ChangeType string `json:"changetype,omitempty"`
Records []Record `json:"records"`
}
RRset represents a resource record set
type Zone ¶
type Zone struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
NotifiedSerial int64 `json:"notified_serial,omitempty"`
AlsoNotify []string `json:"also_notify,omitempty"`
AllowTransferKeys []string `json:"allow_transfer_keys,omitempty"`
RRsets []RRset `json:"rrsets,omitempty"`
}
Zone represents a DNS zone