Documentation ¶
Overview ¶
This package contains a specialized client for interacting with PowerDNS' "Zones" API.
More information ¶
Official API documentation: https://doc.powerdns.com/authoritative/http-api/zone.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ListZones lists known zones for a given serverID ListZones(ctx context.Context, serverID string) ([]Zone, error) // ListZone list known zone for a given serverID and zoneID ListZone(ctx context.Context, serverID string, zoneID string) ([]Zone, error) // CreateZone creates a new zone for a given server. CreateZone(ctx context.Context, serverID string, zone Zone) (*Zone, error) // GetZone returns an existing zone by ID. If not found, the first returned value // will be nil, and the error return value will be an instance of "pdnshttp.ErrNotFound". GetZone(ctx context.Context, serverID string, zoneID string, opts ...GetZoneOption) (*Zone, error) // DeleteZone deletes a zone. No shit. DeleteZone(ctx context.Context, serverID string, zoneID string) error // AddRecordSetToZone will add a new set of records to a zone. Existing record sets for // the exact name/type combination will be replaced. // // Deprecated: Superceded by AddRecordSetsToZone AddRecordSetToZone(ctx context.Context, serverID string, zoneID string, set ResourceRecordSet) error // AddRecordSetsToZone will add new sets of records to a zone. Existing record sets for // the exact name/type combination will be replaced. AddRecordSetsToZone(ctx context.Context, serverID string, zoneID string, sets []ResourceRecordSet) error // RemoveRecordSetFromZone removes a record set from a zone. The record set is matched // by name and type. // // Deprecated: Superceded by RemoveRecordSetsFromZone RemoveRecordSetFromZone(ctx context.Context, serverID string, zoneID string, name string, recordType string) error // RemoveRecordSetsFromZone removes record sets from a zone. The record sets are matched // by name and type. RemoveRecordSetsFromZone(ctx context.Context, serverID string, zoneID string, sets []ResourceRecordSet) error // RetrieveFromMaster retrieves a slave zone from its master RetrieveFromMaster(ctx context.Context, serverID string, zoneID string) error // NotifySlaves sends a DNS NOTIFY to all slaves NotifySlaves(ctx context.Context, serverID string, zoneID string) error // ExportZone exports the entire zone in AXFR format ExportZone(ctx context.Context, serverID string, zoneID string) ([]byte, error) // VerifyZone verifies a zone's configuration VerifyZone(ctx context.Context, serverID string, zoneID string) error // RectifyZone rectifies the zone data RectifyZone(ctx context.Context, serverID string, zoneID string) error }
Client defines the interface for Zone operations.
type GetZoneOption ¶ added in v0.6.1
func WithResourceRecordSetFilter ¶ added in v0.6.1
func WithResourceRecordSetFilter(name, recordType string) GetZoneOption
func WithoutResourceRecordSets ¶ added in v0.6.1
func WithoutResourceRecordSets() GetZoneOption
type RecordSetChangeType ¶
type RecordSetChangeType int
const ( ChangeTypeDelete RecordSetChangeType = iota ChangeTypeReplace )
func (RecordSetChangeType) MarshalJSON ¶
func (k RecordSetChangeType) MarshalJSON() ([]byte, error)
func (*RecordSetChangeType) UnmarshalJSON ¶
func (k *RecordSetChangeType) UnmarshalJSON(input []byte) error
type ResourceRecordSet ¶
type Zone ¶
type Zone struct { ID string `json:"id,omitempty"` Name string `json:"name"` Type ZoneType `json:"type"` URL string `json:"url,omitempty"` Kind ZoneKind `json:"kind,omitempty"` ResourceRecordSets []ResourceRecordSet `json:"rrsets,omitempty"` Serial int `json:"serial,omitempty"` NotifiedSerial int `json:"notified_serial,omitempty"` Masters []string `json:"masters,omitempty"` DNSSec bool `json:"dnssec,omitempty"` NSec3Param string `json:"nsec3param,omitempty"` NSec3Narrow bool `json:"nsec3narrow,omitempty"` Presigned bool `json:"presigned,omitempty"` SOAEdit string `json:"soa_edit,omitempty"` SOAEditAPI string `json:"soa_edit_api,omitempty"` APIRectify bool `json:"api_rectify,omitempty"` Zone string `json:"zone,omitempty"` Account string `json:"account,omitempty"` Nameservers ZoneNameservers `json:"nameservers"` TSIGMasterKeyIDs []string `json:"tsig_master_key_ids,omitempty"` TSIGSlaveKeyIDs []string `json:"tsig_slave_key_ids,omitempty"` }
func (*Zone) GetRecordSet ¶
func (z *Zone) GetRecordSet(name, recordType string) *ResourceRecordSet
type ZoneNameservers ¶ added in v0.3.0
type ZoneNameservers []string
ZoneNameservers is a special list type to represent the nameservers of a zone. When nil, this type will still serialize to an empty JSON list. See https://github.com/mittwald/go-powerdns/issues/4 for more information
func (ZoneNameservers) MarshalJSON ¶ added in v0.3.0
func (z ZoneNameservers) MarshalJSON() ([]byte, error)
MarshalJSON implements the `json.Marshaler` interface
Source Files ¶
- client.go
- doc.go
- interface.go
- types.go
- types_rrsetchangetype.go
- types_zone.go
- types_zonekind.go
- types_zonetype.go
- zones_addrecordset.go
- zones_create.go
- zones_delete.go
- zones_export.go
- zones_get.go
- zones_list.go
- zones_notifyslaves.go
- zones_rectify.go
- zones_removerecordset.go
- zones_retrievemaster.go
- zones_verify.go
Click to show internal directories.
Click to hide internal directories.