Documentation
¶
Index ¶
- Constants
- type APIError
- type BasicZoneInfo
- type Client
- func (client *Client) GetServer(name string) (*Server, error)
- func (client *Client) GetServers() ([]*Server, error)
- func (client *Client) GetZone(server string, zone string) (*Zone, error)
- func (client *Client) GetZones(server string) ([]*Zone, error)
- func (client *Client) UpdateZone(server string, zone string, rrSetsPayload []RRSet) error
- type Comment
- type Config
- type RRSet
- type Record
- type RecordType
- type Server
- type Zone
Constants ¶
const ( // ZoneKindNative - Native kind of zone ZoneKindNative string = "Native" // ZoneKindMaster - Master kind of zone ZoneKindMaster string = "Master" // ZoneKindSlave - Slave kind of zone ZoneKindSlave string = "Slave" // ChangetypeReplace - type of operation - REPLACE ChangetypeReplace changetype = "REPLACE" // ChangetypeDelete - type of operation - DELETE ChangetypeDelete changetype = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError - represents a error which returned from PowerDNS API https://doc.powerdns.com/md/httpapi/api_spec/#errors
type BasicZoneInfo ¶
type BasicZoneInfo struct {
Account string `json:"account,omitempty"`
DNSSec bool `json:"dnssec,omitempty"`
ID string `json:"id,omitempty"`
Kind string `json:"kind,omitempty"`
LastCheck int64 `json:"last_check,omitempty"`
Masters []string `json:"masters,omitempty"`
Name string `json:"string,omitempty"`
NotifiedSerial int64 `json:"notified_serial,omitempty"`
Serial int64 `json:"serial,omitempty"`
URL string `json:"url,omitempty"`
}
BasicZoneInfo - reduced representation of zone without RRSet
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - represents a PowerDNS metadata which needs to interact with PowerDNS server
func (*Client) GetServers ¶
GetServers - return all servers which confugured in PowerDNS
type Comment ¶
type Comment struct {
Content string `json:"content"`
Account string `json:"account"`
ModifiedAt int64 `json:"modified_at"`
}
Comment - represents commet block in RRSet definition https://doc.powerdns.com/md/httpapi/api_spec/#zones
type Config ¶
type Config struct {
Name string `json:"name"`
Type string `json:"type"`
Value string `json:"value"`
}
Config - represents config resource https://doc.powerdns.com/md/httpapi/api_spec/#config95setting95resource
type RRSet ¶
type RRSet struct {
Name string `json:"name"`
Type RecordType `json:"type"`
TTL int64 `json:"ttl"`
Records []Record `json:"records"`
Comments []Comment `json:"comments"`
Changetype changetype `json:"changetype,omitempty"`
}
RRSet - represents RRSet which make up zone https://doc.powerdns.com/md/httpapi/api_spec/#zones
type Record ¶
Record - represents record in RRSet definition https://doc.powerdns.com/md/httpapi/api_spec/#zones
type RecordType ¶
type RecordType string
RecordType - special type for represents type of record
const ( // TypeMX - MX record type TypeMX RecordType = "MX" // TypeA - A record type TypeA RecordType = "A" // TypeAAAA - AAAA record type TypeAAAA RecordType = "AAAA" // TypeNS - NS record type TypeNS RecordType = "NS" // TypeSOA - SOA record type TypeSOA RecordType = "SOA" // TypeCNAME - CNAME record type TypeCNAME RecordType = "CNAME" // TypeTXT - TXT record type TypeTXT RecordType = "TXT" // TypePTR - PTR record type TypePTR RecordType = "PTR" // TypeSRV - SRV record type TypeSRV RecordType = "SRV" )
type Server ¶
type Server struct {
ConfigURL string `json:"config_url"`
DaemonType string `json:"daemon_type"`
ID string `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Version string `json:"version"`
ZonesURL string `json:"zones_url"`
}
Server - represent `Servers` resource https://doc.powerdns.com/md/httpapi/api_spec/#servers
type Zone ¶
type Zone struct {
BasicZoneInfo
Nameservers []string `json:"nameservers,omitempty"`
Servers []string `json:"servers,omitempty"`
RRSets []RRSet `json:"rrsets,omitempty"`
SOAEdit string `json:"soa_edit,omitempty"`
SOAEditAPI string `json:"soa_edit_api,omitempty"`
}
Zone - represents zone https://doc.powerdns.com/md/httpapi/api_spec/#zones
func (*Zone) GetSOARecord ¶
GetSOARecord - returns SOA record of the zone
func (*Zone) QueryRecords ¶
QueryRecords - find and return records filtered by name or content