interface.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. // Package simpledbiface provides an interface to enable mocking the Amazon SimpleDB 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 simpledbiface
  9. import (
  10. "github.com/aws/aws-sdk-go/aws"
  11. "github.com/aws/aws-sdk-go/aws/request"
  12. "github.com/aws/aws-sdk-go/service/simpledb"
  13. )
  14. // SimpleDBAPI provides an interface to enable mocking the
  15. // simpledb.SimpleDB service client's API operation,
  16. // paginators, and waiters. This make unit testing your code that calls out
  17. // to the SDK's service client's calls easier.
  18. //
  19. // The best way to use this interface is so the SDK's service client's calls
  20. // can be stubbed out for unit testing your code with the SDK without needing
  21. // to inject custom request handlers into the SDK's request pipeline.
  22. //
  23. // // myFunc uses an SDK service client to make a request to
  24. // // Amazon SimpleDB.
  25. // func myFunc(svc simpledbiface.SimpleDBAPI) bool {
  26. // // Make svc.BatchDeleteAttributes request
  27. // }
  28. //
  29. // func main() {
  30. // sess := session.New()
  31. // svc := simpledb.New(sess)
  32. //
  33. // myFunc(svc)
  34. // }
  35. //
  36. // In your _test.go file:
  37. //
  38. // // Define a mock struct to be used in your unit tests of myFunc.
  39. // type mockSimpleDBClient struct {
  40. // simpledbiface.SimpleDBAPI
  41. // }
  42. // func (m *mockSimpleDBClient) BatchDeleteAttributes(input *simpledb.BatchDeleteAttributesInput) (*simpledb.BatchDeleteAttributesOutput, error) {
  43. // // mock response/functionality
  44. // }
  45. //
  46. // func TestMyFunc(t *testing.T) {
  47. // // Setup Test
  48. // mockSvc := &mockSimpleDBClient{}
  49. //
  50. // myfunc(mockSvc)
  51. //
  52. // // Verify myFunc's functionality
  53. // }
  54. //
  55. // It is important to note that this interface will have breaking changes
  56. // when the service model is updated and adds new API operations, paginators,
  57. // and waiters. Its suggested to use the pattern above for testing, or using
  58. // tooling to generate mocks to satisfy the interfaces.
  59. type SimpleDBAPI interface {
  60. BatchDeleteAttributes(*simpledb.BatchDeleteAttributesInput) (*simpledb.BatchDeleteAttributesOutput, error)
  61. BatchDeleteAttributesWithContext(aws.Context, *simpledb.BatchDeleteAttributesInput, ...request.Option) (*simpledb.BatchDeleteAttributesOutput, error)
  62. BatchDeleteAttributesRequest(*simpledb.BatchDeleteAttributesInput) (*request.Request, *simpledb.BatchDeleteAttributesOutput)
  63. BatchPutAttributes(*simpledb.BatchPutAttributesInput) (*simpledb.BatchPutAttributesOutput, error)
  64. BatchPutAttributesWithContext(aws.Context, *simpledb.BatchPutAttributesInput, ...request.Option) (*simpledb.BatchPutAttributesOutput, error)
  65. BatchPutAttributesRequest(*simpledb.BatchPutAttributesInput) (*request.Request, *simpledb.BatchPutAttributesOutput)
  66. CreateDomain(*simpledb.CreateDomainInput) (*simpledb.CreateDomainOutput, error)
  67. CreateDomainWithContext(aws.Context, *simpledb.CreateDomainInput, ...request.Option) (*simpledb.CreateDomainOutput, error)
  68. CreateDomainRequest(*simpledb.CreateDomainInput) (*request.Request, *simpledb.CreateDomainOutput)
  69. DeleteAttributes(*simpledb.DeleteAttributesInput) (*simpledb.DeleteAttributesOutput, error)
  70. DeleteAttributesWithContext(aws.Context, *simpledb.DeleteAttributesInput, ...request.Option) (*simpledb.DeleteAttributesOutput, error)
  71. DeleteAttributesRequest(*simpledb.DeleteAttributesInput) (*request.Request, *simpledb.DeleteAttributesOutput)
  72. DeleteDomain(*simpledb.DeleteDomainInput) (*simpledb.DeleteDomainOutput, error)
  73. DeleteDomainWithContext(aws.Context, *simpledb.DeleteDomainInput, ...request.Option) (*simpledb.DeleteDomainOutput, error)
  74. DeleteDomainRequest(*simpledb.DeleteDomainInput) (*request.Request, *simpledb.DeleteDomainOutput)
  75. DomainMetadata(*simpledb.DomainMetadataInput) (*simpledb.DomainMetadataOutput, error)
  76. DomainMetadataWithContext(aws.Context, *simpledb.DomainMetadataInput, ...request.Option) (*simpledb.DomainMetadataOutput, error)
  77. DomainMetadataRequest(*simpledb.DomainMetadataInput) (*request.Request, *simpledb.DomainMetadataOutput)
  78. GetAttributes(*simpledb.GetAttributesInput) (*simpledb.GetAttributesOutput, error)
  79. GetAttributesWithContext(aws.Context, *simpledb.GetAttributesInput, ...request.Option) (*simpledb.GetAttributesOutput, error)
  80. GetAttributesRequest(*simpledb.GetAttributesInput) (*request.Request, *simpledb.GetAttributesOutput)
  81. ListDomains(*simpledb.ListDomainsInput) (*simpledb.ListDomainsOutput, error)
  82. ListDomainsWithContext(aws.Context, *simpledb.ListDomainsInput, ...request.Option) (*simpledb.ListDomainsOutput, error)
  83. ListDomainsRequest(*simpledb.ListDomainsInput) (*request.Request, *simpledb.ListDomainsOutput)
  84. ListDomainsPages(*simpledb.ListDomainsInput, func(*simpledb.ListDomainsOutput, bool) bool) error
  85. ListDomainsPagesWithContext(aws.Context, *simpledb.ListDomainsInput, func(*simpledb.ListDomainsOutput, bool) bool, ...request.Option) error
  86. PutAttributes(*simpledb.PutAttributesInput) (*simpledb.PutAttributesOutput, error)
  87. PutAttributesWithContext(aws.Context, *simpledb.PutAttributesInput, ...request.Option) (*simpledb.PutAttributesOutput, error)
  88. PutAttributesRequest(*simpledb.PutAttributesInput) (*request.Request, *simpledb.PutAttributesOutput)
  89. Select(*simpledb.SelectInput) (*simpledb.SelectOutput, error)
  90. SelectWithContext(aws.Context, *simpledb.SelectInput, ...request.Option) (*simpledb.SelectOutput, error)
  91. SelectRequest(*simpledb.SelectInput) (*request.Request, *simpledb.SelectOutput)
  92. SelectPages(*simpledb.SelectInput, func(*simpledb.SelectOutput, bool) bool) error
  93. SelectPagesWithContext(aws.Context, *simpledb.SelectInput, func(*simpledb.SelectOutput, bool) bool, ...request.Option) error
  94. }
  95. var _ SimpleDBAPI = (*simpledb.SimpleDB)(nil)