Documentation ¶
Index ¶
- Constants
- type AWSClient
- type AWSClientMock
- func (mock *AWSClientMock) ChangeResourceRecordSets(dnsName string, recordChangeBatch *route53.ChangeBatch) (*route53.ChangeResourceRecordSetsOutput, error)
- func (mock *AWSClientMock) ChangeResourceRecordSetsCalls() []struct{ ... }
- func (mock *AWSClientMock) GetChange(changeId string) (*route53.GetChangeOutput, error)
- func (mock *AWSClientMock) GetChangeCalls() []struct{ ... }
- func (mock *AWSClientMock) ListHostedZonesByNameInput(dnsName string) (*route53.ListHostedZonesByNameOutput, error)
- func (mock *AWSClientMock) ListHostedZonesByNameInputCalls() []struct{ ... }
- type ClientFactory
- type Config
- type DefaultClientFactory
- type MockClientFactory
- type Route53API
Constants ¶
View Source
const ( DefaultAWSRoute53Region = "us-east-1" DefaultGCPRoute53Region = "us-east-1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSClient ¶
type AWSClient interface { // route53 ListHostedZonesByNameInput(dnsName string) (*route53.ListHostedZonesByNameOutput, error) ChangeResourceRecordSets(dnsName string, recordChangeBatch *route53.ChangeBatch) (*route53.ChangeResourceRecordSetsOutput, error) GetChange(changeId string) (*route53.GetChangeOutput, error) }
type AWSClientMock ¶
type AWSClientMock struct { // ChangeResourceRecordSetsFunc mocks the ChangeResourceRecordSets method. ChangeResourceRecordSetsFunc func(dnsName string, recordChangeBatch *route53.ChangeBatch) (*route53.ChangeResourceRecordSetsOutput, error) // GetChangeFunc mocks the GetChange method. GetChangeFunc func(changeId string) (*route53.GetChangeOutput, error) // ListHostedZonesByNameInputFunc mocks the ListHostedZonesByNameInput method. ListHostedZonesByNameInputFunc func(dnsName string) (*route53.ListHostedZonesByNameOutput, error) // contains filtered or unexported fields }
AWSClientMock is a mock implementation of AWSClient.
func TestSomethingThatUsesAWSClient(t *testing.T) { // make and configure a mocked AWSClient mockedAWSClient := &AWSClientMock{ ChangeResourceRecordSetsFunc: func(dnsName string, recordChangeBatch *route53.ChangeBatch) (*route53.ChangeResourceRecordSetsOutput, error) { panic("mock out the ChangeResourceRecordSets method") }, GetChangeFunc: func(changeId string) (*route53.GetChangeOutput, error) { panic("mock out the GetChange method") }, ListHostedZonesByNameInputFunc: func(dnsName string) (*route53.ListHostedZonesByNameOutput, error) { panic("mock out the ListHostedZonesByNameInput method") }, } // use mockedAWSClient in code that requires AWSClient // and then make assertions. }
func (*AWSClientMock) ChangeResourceRecordSets ¶
func (mock *AWSClientMock) ChangeResourceRecordSets(dnsName string, recordChangeBatch *route53.ChangeBatch) (*route53.ChangeResourceRecordSetsOutput, error)
ChangeResourceRecordSets calls ChangeResourceRecordSetsFunc.
func (*AWSClientMock) ChangeResourceRecordSetsCalls ¶
func (mock *AWSClientMock) ChangeResourceRecordSetsCalls() []struct { DnsName string RecordChangeBatch *route53.ChangeBatch }
ChangeResourceRecordSetsCalls gets all the calls that were made to ChangeResourceRecordSets. Check the length with:
len(mockedAWSClient.ChangeResourceRecordSetsCalls())
func (*AWSClientMock) GetChange ¶
func (mock *AWSClientMock) GetChange(changeId string) (*route53.GetChangeOutput, error)
GetChange calls GetChangeFunc.
func (*AWSClientMock) GetChangeCalls ¶
func (mock *AWSClientMock) GetChangeCalls() []struct { ChangeId string }
GetChangeCalls gets all the calls that were made to GetChange. Check the length with:
len(mockedAWSClient.GetChangeCalls())
func (*AWSClientMock) ListHostedZonesByNameInput ¶
func (mock *AWSClientMock) ListHostedZonesByNameInput(dnsName string) (*route53.ListHostedZonesByNameOutput, error)
ListHostedZonesByNameInput calls ListHostedZonesByNameInputFunc.
func (*AWSClientMock) ListHostedZonesByNameInputCalls ¶
func (mock *AWSClientMock) ListHostedZonesByNameInputCalls() []struct { DnsName string }
ListHostedZonesByNameInputCalls gets all the calls that were made to ListHostedZonesByNameInput. Check the length with:
len(mockedAWSClient.ListHostedZonesByNameInputCalls())
type ClientFactory ¶
type Config ¶
type Config struct { // AccessKeyID is the AWS access key identifier. AccessKeyID string // SecretAccessKey is the AWS secret access key. SecretAccessKey string }
Config contains the AWS settings
type DefaultClientFactory ¶
type DefaultClientFactory struct{}
func NewDefaultClientFactory ¶
func NewDefaultClientFactory() *DefaultClientFactory
type MockClientFactory ¶
type MockClientFactory struct {
// contains filtered or unexported fields
}
func NewMockClientFactory ¶
func NewMockClientFactory(client AWSClient) *MockClientFactory
type Route53API ¶
type Route53API route53Client
Click to show internal directories.
Click to hide internal directories.