interface.go 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package dynamodbstreamsiface provides an interface to enable mocking the Amazon DynamoDB Streams service client
  3. // for testing your code.
  4. //
  5. // It is important to note that this interface will have breaking changes
  6. // when the service model is updated and adds new API operations, paginators,
  7. // and waiters.
  8. package dynamodbstreamsiface
  9. import (
  10. "github.com/aws/aws-sdk-go/aws/request"
  11. "github.com/aws/aws-sdk-go/service/dynamodbstreams"
  12. )
  13. // DynamoDBStreamsAPI provides an interface to enable mocking the
  14. // dynamodbstreams.DynamoDBStreams service client's API operation,
  15. // paginators, and waiters. This make unit testing your code that calls out
  16. // to the SDK's service client's calls easier.
  17. //
  18. // The best way to use this interface is so the SDK's service client's calls
  19. // can be stubbed out for unit testing your code with the SDK without needing
  20. // to inject custom request handlers into the the SDK's request pipeline.
  21. //
  22. // // myFunc uses an SDK service client to make a request to
  23. // // Amazon DynamoDB Streams.
  24. // func myFunc(svc dynamodbstreamsiface.DynamoDBStreamsAPI) bool {
  25. // // Make svc.DescribeStream request
  26. // }
  27. //
  28. // func main() {
  29. // sess := session.New()
  30. // svc := dynamodbstreams.New(sess)
  31. //
  32. // myFunc(svc)
  33. // }
  34. //
  35. // In your _test.go file:
  36. //
  37. // // Define a mock struct to be used in your unit tests of myFunc.
  38. // type mockDynamoDBStreamsClient struct {
  39. // dynamodbstreamsiface.DynamoDBStreamsAPI
  40. // }
  41. // func (m *mockDynamoDBStreamsClient) DescribeStream(input *dynamodbstreams.DescribeStreamInput) (*dynamodbstreams.DescribeStreamOutput, error) {
  42. // // mock response/functionality
  43. // }
  44. //
  45. // TestMyFunc(t *testing.T) {
  46. // // Setup Test
  47. // mockSvc := &mockDynamoDBStreamsClient{}
  48. //
  49. // myfunc(mockSvc)
  50. //
  51. // // Verify myFunc's functionality
  52. // }
  53. //
  54. // It is important to note that this interface will have breaking changes
  55. // when the service model is updated and adds new API operations, paginators,
  56. // and waiters. Its suggested to use the pattern above for testing, or using
  57. // tooling to generate mocks to satisfy the interfaces.
  58. type DynamoDBStreamsAPI interface {
  59. DescribeStreamRequest(*dynamodbstreams.DescribeStreamInput) (*request.Request, *dynamodbstreams.DescribeStreamOutput)
  60. DescribeStream(*dynamodbstreams.DescribeStreamInput) (*dynamodbstreams.DescribeStreamOutput, error)
  61. GetRecordsRequest(*dynamodbstreams.GetRecordsInput) (*request.Request, *dynamodbstreams.GetRecordsOutput)
  62. GetRecords(*dynamodbstreams.GetRecordsInput) (*dynamodbstreams.GetRecordsOutput, error)
  63. GetShardIteratorRequest(*dynamodbstreams.GetShardIteratorInput) (*request.Request, *dynamodbstreams.GetShardIteratorOutput)
  64. GetShardIterator(*dynamodbstreams.GetShardIteratorInput) (*dynamodbstreams.GetShardIteratorOutput, error)
  65. ListStreamsRequest(*dynamodbstreams.ListStreamsInput) (*request.Request, *dynamodbstreams.ListStreamsOutput)
  66. ListStreams(*dynamodbstreams.ListStreamsInput) (*dynamodbstreams.ListStreamsOutput, error)
  67. }
  68. var _ DynamoDBStreamsAPI = (*dynamodbstreams.DynamoDBStreams)(nil)