Documentation ¶
Index ¶
- Constants
- type PDNSAPIClient
- func (c *PDNSAPIClient) ListZone(zoneID string) (zone pgo.Zone, resp *http.Response, err error)
- func (c *PDNSAPIClient) ListZones() (zones []pgo.Zone, resp *http.Response, err error)
- func (c *PDNSAPIClient) PartitionZones(zones []pgo.Zone) (filteredZones []pgo.Zone, residualZones []pgo.Zone)
- func (c *PDNSAPIClient) PatchZone(zoneID string, zoneStruct pgo.Zone) (resp *http.Response, err error)
- type PDNSAPIProvider
- type PDNSConfig
- type PDNSProvider
- func (p *PDNSProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (p *PDNSProvider) ConvertEndpointsToZones(eps []*endpoint.Endpoint, changetype pdnsChangeType) (zonelist []pgo.Zone, _ error)
- func (p *PDNSProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, _ error)
- type TLSConfig
Constants ¶
const ( // PdnsDelete : PowerDNS changetype used for deleting rrsets // ref: https://doc.powerdns.com/authoritative/http-api/zone.html#rrset (see "changetype") PdnsDelete pdnsChangeType = "DELETE" // PdnsReplace : PowerDNS changetype for creating, updating and patching rrsets PdnsReplace pdnsChangeType = "REPLACE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDNSAPIClient ¶
type PDNSAPIClient struct {
// contains filtered or unexported fields
}
PDNSAPIClient : Struct that encapsulates all the PowerDNS specific implementation details
func (*PDNSAPIClient) ListZone ¶
ListZone : Method returns the details of a specific zone from PowerDNS ref: https://doc.powerdns.com/authoritative/http-api/zone.html#get--servers-server_id-zones-zone_id
func (*PDNSAPIClient) ListZones ¶
ListZones : Method returns all enabled zones from PowerDNS ref: https://doc.powerdns.com/authoritative/http-api/zone.html#get--servers-server_id-zones
func (*PDNSAPIClient) PartitionZones ¶
func (c *PDNSAPIClient) PartitionZones(zones []pgo.Zone) (filteredZones []pgo.Zone, residualZones []pgo.Zone)
PartitionZones : Method returns a slice of zones that adhere to the domain filter and a slice of ones that does not adhere to the filter
func (*PDNSAPIClient) PatchZone ¶
func (c *PDNSAPIClient) PatchZone(zoneID string, zoneStruct pgo.Zone) (resp *http.Response, err error)
PatchZone : Method used to update the contents of a particular zone from PowerDNS ref: https://doc.powerdns.com/authoritative/http-api/zone.html#patch--servers-server_id-zones-zone_id
type PDNSAPIProvider ¶
type PDNSAPIProvider interface { ListZones() ([]pgo.Zone, *http.Response, error) PartitionZones(zones []pgo.Zone) ([]pgo.Zone, []pgo.Zone) ListZone(zoneID string) (pgo.Zone, *http.Response, error) PatchZone(zoneID string, zoneStruct pgo.Zone) (*http.Response, error) }
PDNSAPIProvider : Interface used and extended by the PDNSAPIClient struct as well as mock APIClients used in testing
type PDNSConfig ¶
type PDNSConfig struct { DomainFilter endpoint.DomainFilter DryRun bool Server string APIKey string TLSConfig TLSConfig }
PDNSConfig is comprised of the fields necessary to create a new PDNSProvider
type PDNSProvider ¶
type PDNSProvider struct { provider.BaseProvider // contains filtered or unexported fields }
PDNSProvider is an implementation of the Provider interface for PowerDNS
func NewPDNSProvider ¶
func NewPDNSProvider(ctx context.Context, config PDNSConfig) (*PDNSProvider, error)
NewPDNSProvider initializes a new PowerDNS based Provider.
func (*PDNSProvider) ApplyChanges ¶
ApplyChanges takes a list of changes (endpoints) and updates the PDNS server by sending the correct HTTP PATCH requests to a matching zone
func (*PDNSProvider) ConvertEndpointsToZones ¶
func (p *PDNSProvider) ConvertEndpointsToZones(eps []*endpoint.Endpoint, changetype pdnsChangeType) (zonelist []pgo.Zone, _ error)
ConvertEndpointsToZones marshals endpoints into pdns compatible Zone structs