awsifaces
A go module containing generated interfaces and mocks for services in aws-sdk-go-v2.
Installation
go get github.com/jbreindel/awsifaces
While go will eliminate any unused code, you can simply copy any of these interfaces into your project if you don't want additional dependencies.
Usage
func NewSqs(cfg aws.Config) SqsClient {
return sqs.NewFromConfig(cfg)
}
mockSqsClient := new(mocks.SqsClient)
mockSqsClient.On("SendMessage", mock.Anything, mock.Anything, mock.Anything).Return(&sqs.SendMessageOutput{
...
}, nil).Once()
for additional usage options see mockery.