Documentation ¶
Index ¶
- Variables
- type ErrorReader
- type MockCloudflareSDKClient
- func (c *MockCloudflareSDKClient) CreateDNSRecord(ctx context.Context, zoneID string, rr sdk.DNSRecord) (*sdk.DNSRecordResponse, error)
- func (c *MockCloudflareSDKClient) DNSRecord(ctx context.Context, zoneID string, recordID string) (sdk.DNSRecord, error)
- func (c *MockCloudflareSDKClient) DNSRecords(ctx context.Context, zoneID string, rr sdk.DNSRecord) ([]sdk.DNSRecord, error)
- func (c *MockCloudflareSDKClient) DeleteDNSRecord(ctx context.Context, zoneID string, recordID string) error
- func (c *MockCloudflareSDKClient) UpdateDNSRecord(ctx context.Context, zoneID string, recordID string, rr sdk.DNSRecord) error
- func (c *MockCloudflareSDKClient) ZoneIDByName(zoneName string) (string, error)
- type MockHTTPClient
- type MockSchedulerClient
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultDNSRecord is used as the default option for the corresponding function DefaultDNSRecord sdk.DNSRecord = sdk.DNSRecord{ ID: "1234", Type: "TXT", Name: "test", Content: "foobar", ZoneID: "zone1234", ZoneName: "foo.bar", Proxied: boolPtr(false), } // DefaultDNSRecords is used as the default option for the corresponding function DefaultDNSRecords []sdk.DNSRecord = []sdk.DNSRecord{DefaultDNSRecord} // DefaultZoneID is used as the default option for the corresponding function DefaultZoneID string = "zone1234" )
var ( // DefaultExternalIPAddress is the default IP address returned DefaultExternalIPAddress = "1.2.3.4" // DefaultDoResponse is the default response for this function DefaultDoResponse *http.Response = &http.Response{ StatusCode: 200, Body: io.NopCloser(strings.NewReader(DefaultExternalIPAddress)), } )
var ( // DefaultSchedulerDoResponse is the default response for this function DefaultSchedulerDoResponse *gocron.Job = &gocron.Job{} )
Functions ¶
This section is empty.
Types ¶
type ErrorReader ¶
type ErrorReader struct {
Error error
}
ErrorReader is a mocked io.ReadCloser that returns erorr when reading
func (*ErrorReader) Close ¶
func (e *ErrorReader) Close() error
Close returns an error when closing the reader
type MockCloudflareSDKClient ¶
type MockCloudflareSDKClient struct{}
MockCloudflareSDKClient mocks the internal client from Cloudflare
func (*MockCloudflareSDKClient) CreateDNSRecord ¶
func (c *MockCloudflareSDKClient) CreateDNSRecord(ctx context.Context, zoneID string, rr sdk.DNSRecord) (*sdk.DNSRecordResponse, error)
CreateDNSRecord implements corresponding client function
func (*MockCloudflareSDKClient) DNSRecord ¶
func (c *MockCloudflareSDKClient) DNSRecord(ctx context.Context, zoneID string, recordID string) (sdk.DNSRecord, error)
DNSRecord implements corresponding client function
func (*MockCloudflareSDKClient) DNSRecords ¶
func (c *MockCloudflareSDKClient) DNSRecords(ctx context.Context, zoneID string, rr sdk.DNSRecord) ([]sdk.DNSRecord, error)
DNSRecords implements corresponding client function
func (*MockCloudflareSDKClient) DeleteDNSRecord ¶
func (c *MockCloudflareSDKClient) DeleteDNSRecord(ctx context.Context, zoneID string, recordID string) error
DeleteDNSRecord implements corresponding client function
func (*MockCloudflareSDKClient) UpdateDNSRecord ¶
func (c *MockCloudflareSDKClient) UpdateDNSRecord(ctx context.Context, zoneID string, recordID string, rr sdk.DNSRecord) error
UpdateDNSRecord implements corresponding client function
func (*MockCloudflareSDKClient) ZoneIDByName ¶
func (c *MockCloudflareSDKClient) ZoneIDByName(zoneName string) (string, error)
ZoneIDByName implements corresponding client function
type MockHTTPClient ¶
type MockHTTPClient struct{}
MockHTTPClient mocks the internal client for http.Client
type MockSchedulerClient ¶
type MockSchedulerClient struct{}
MockSchedulerClient mocks the internal scheduler
func (*MockSchedulerClient) Do ¶
func (c *MockSchedulerClient) Do(jobFun interface{}, params ...interface{}) (*gocron.Job, error)
Do implements corresponding client function
func (*MockSchedulerClient) StartBlocking ¶
func (c *MockSchedulerClient) StartBlocking()
StartBlocking implements corresponding client function