Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CfDNSOperations ¶
type CfDNSOperations interface { ZoneIDByName(zoneName string) (string, error) DNSRecords(zoneID string, rr cloudflare.DNSRecord) ([]cloudflare.DNSRecord, error) DNSRecord(zoneID, recordID string) (cloudflare.DNSRecord, error) CreateDNSRecord(zoneID string, rr cloudflare.DNSRecord) (*cloudflare.DNSRecordResponse, error) UpdateDNSRecord(zoneID, recordID string, rr cloudflare.DNSRecord) error }
CloudflareOperations this is the implicit, partial interface of the relevant operations present in the official Cloudflare Golang SDK. By interfacing this we make easier to create test doubles and DI.
type DNSClient ¶
type DNSClient interface { UpdateDNS(dnsName string, ipAddress string) error CreateDNS(dnsName string, ipAddress string) error DataForDNS(dnsName string) (string, error) UpsertDNSEntry(dnsName string, ipAddress string) error UpsertDNSEntries(dnsEntries []string, ipAddress string) error }
DNSClient is the interface for the relevant DNS operations required.
The main implementation is a wrapper around Cloudflare Go SDK that allows managing DNS entries. More specifically, create, update or obtain A records (IP address) linked with a dns name. Zone should be created beforehand in Cloudflare. An valid API key and email are required to use the client.
Note: This interface should have a GCP implementation as well.
func NewFromEnv ¶
CF_API_KEY from gs://xxx-keys/cf-key.dec CF_EMAIL