Documentation ¶
Index ¶
- type AWSClient
- type Client
- type Cloudflarer
- type MockAWSClient
- type MockCloudflare
- func (c *MockCloudflare) CreateDNSRecord(ctx context.Context, zoneID string, rr cf.DNSRecord) (*cf.DNSRecordResponse, error)
- func (c *MockCloudflare) DNSRecords(ctx context.Context, zoneID string, rr cf.DNSRecord) ([]cf.DNSRecord, error)
- func (c *MockCloudflare) DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error
- func (c *MockCloudflare) UpdateDNSRecord(ctx context.Context, zoneID, recordID string, rr cf.DNSRecord) error
- func (c *MockCloudflare) ZoneIDByName(zoneName string) (string, error)
- type NoopCloudflarer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSClient ¶
type AWSClient interface {
GetPublicHostedZoneNames() []string
}
AWSClient interface that holds AWS client function
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper on to of Cloudflare library client.
func NewClientWithToken ¶
func NewClientWithToken(client Cloudflarer, aws AWSClient) *Client
NewClientWithToken creates a new client that can be used to run the other functions.
func (*Client) CreateDNSRecords ¶
func (c *Client) CreateDNSRecords(dnsNames []string, dnsEndpoints []string, logger logrus.FieldLogger) error
CreateDNSRecords creates a DNS records in the first given Cloudflare zone name of the list
func (*Client) DeleteDNSRecords ¶
func (c *Client) DeleteDNSRecords(dnsNames []string, logger logrus.FieldLogger) error
DeleteDNSRecords gets DNS name and zone name which uses to delete that DNS record from Cloudflare
type Cloudflarer ¶
type Cloudflarer interface { ZoneIDByName(zoneName string) (string, error) DNSRecords(ctx context.Context, zoneID string, rr cf.DNSRecord) ([]cf.DNSRecord, error) CreateDNSRecord(ctx context.Context, zoneID string, rr cf.DNSRecord) (*cf.DNSRecordResponse, error) UpdateDNSRecord(ctx context.Context, zoneID, recordID string, rr cf.DNSRecord) error DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error }
Cloudflarer interface that holds Cloudflare functions
type MockAWSClient ¶
type MockAWSClient struct {
// contains filtered or unexported fields
}
MockAWSClient mocks the AWS client interface
func (*MockAWSClient) GetPublicHostedZoneNames ¶
func (a *MockAWSClient) GetPublicHostedZoneNames() []string
GetPublicHostedZoneNames mocks AWS client method
type MockCloudflare ¶
type MockCloudflare struct {
// contains filtered or unexported fields
}
MockCloudflare mocks the Cloudflarer interface
func (*MockCloudflare) CreateDNSRecord ¶
func (c *MockCloudflare) CreateDNSRecord(ctx context.Context, zoneID string, rr cf.DNSRecord) (*cf.DNSRecordResponse, error)
CreateDNSRecord mocks cloudflare package same method
func (*MockCloudflare) DNSRecords ¶
func (c *MockCloudflare) DNSRecords(ctx context.Context, zoneID string, rr cf.DNSRecord) ([]cf.DNSRecord, error)
DNSRecords mocks cloudflare package same method
func (*MockCloudflare) DeleteDNSRecord ¶
func (c *MockCloudflare) DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error
DeleteDNSRecord mocks cloudflare package same method
func (*MockCloudflare) UpdateDNSRecord ¶ added in v0.56.0
func (c *MockCloudflare) UpdateDNSRecord(ctx context.Context, zoneID, recordID string, rr cf.DNSRecord) error
UpdateDNSRecord mocks cloudflare package same method
func (*MockCloudflare) ZoneIDByName ¶
func (c *MockCloudflare) ZoneIDByName(zoneName string) (string, error)
ZoneIDByName mocks the getZoneID
type NoopCloudflarer ¶
type NoopCloudflarer struct{}
NoopCloudflarer is used as a dummy Cloudflarer interface
func NoopClient ¶
func NoopClient() *NoopCloudflarer
NoopClient returns an empty noopCloudflarer struct
func (*NoopCloudflarer) CreateDNSRecords ¶
func (*NoopCloudflarer) CreateDNSRecords(_ []string, _ []string, logger logrus.FieldLogger) error
CreateDNSRecords returns an empty dummy func for noopCloudflarer
func (*NoopCloudflarer) DeleteDNSRecords ¶
func (*NoopCloudflarer) DeleteDNSRecords(_ []string, logger logrus.FieldLogger) error
DeleteDNSRecords returns an empty dummy func for noopCloudflarer