interface.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package ecriface provides an interface to enable mocking the Amazon EC2 Container Registry 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 ecriface
  9. import (
  10. "github.com/aws/aws-sdk-go/aws/request"
  11. "github.com/aws/aws-sdk-go/service/ecr"
  12. )
  13. // ECRAPI provides an interface to enable mocking the
  14. // ecr.ECR 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 EC2 Container Registry.
  24. // func myFunc(svc ecriface.ECRAPI) bool {
  25. // // Make svc.BatchCheckLayerAvailability request
  26. // }
  27. //
  28. // func main() {
  29. // sess := session.New()
  30. // svc := ecr.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 mockECRClient struct {
  39. // ecriface.ECRAPI
  40. // }
  41. // func (m *mockECRClient) BatchCheckLayerAvailability(input *ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error) {
  42. // // mock response/functionality
  43. // }
  44. //
  45. // TestMyFunc(t *testing.T) {
  46. // // Setup Test
  47. // mockSvc := &mockECRClient{}
  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 ECRAPI interface {
  59. BatchCheckLayerAvailabilityRequest(*ecr.BatchCheckLayerAvailabilityInput) (*request.Request, *ecr.BatchCheckLayerAvailabilityOutput)
  60. BatchCheckLayerAvailability(*ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error)
  61. BatchDeleteImageRequest(*ecr.BatchDeleteImageInput) (*request.Request, *ecr.BatchDeleteImageOutput)
  62. BatchDeleteImage(*ecr.BatchDeleteImageInput) (*ecr.BatchDeleteImageOutput, error)
  63. BatchGetImageRequest(*ecr.BatchGetImageInput) (*request.Request, *ecr.BatchGetImageOutput)
  64. BatchGetImage(*ecr.BatchGetImageInput) (*ecr.BatchGetImageOutput, error)
  65. CompleteLayerUploadRequest(*ecr.CompleteLayerUploadInput) (*request.Request, *ecr.CompleteLayerUploadOutput)
  66. CompleteLayerUpload(*ecr.CompleteLayerUploadInput) (*ecr.CompleteLayerUploadOutput, error)
  67. CreateRepositoryRequest(*ecr.CreateRepositoryInput) (*request.Request, *ecr.CreateRepositoryOutput)
  68. CreateRepository(*ecr.CreateRepositoryInput) (*ecr.CreateRepositoryOutput, error)
  69. DeleteRepositoryRequest(*ecr.DeleteRepositoryInput) (*request.Request, *ecr.DeleteRepositoryOutput)
  70. DeleteRepository(*ecr.DeleteRepositoryInput) (*ecr.DeleteRepositoryOutput, error)
  71. DeleteRepositoryPolicyRequest(*ecr.DeleteRepositoryPolicyInput) (*request.Request, *ecr.DeleteRepositoryPolicyOutput)
  72. DeleteRepositoryPolicy(*ecr.DeleteRepositoryPolicyInput) (*ecr.DeleteRepositoryPolicyOutput, error)
  73. DescribeImagesRequest(*ecr.DescribeImagesInput) (*request.Request, *ecr.DescribeImagesOutput)
  74. DescribeImages(*ecr.DescribeImagesInput) (*ecr.DescribeImagesOutput, error)
  75. DescribeRepositoriesRequest(*ecr.DescribeRepositoriesInput) (*request.Request, *ecr.DescribeRepositoriesOutput)
  76. DescribeRepositories(*ecr.DescribeRepositoriesInput) (*ecr.DescribeRepositoriesOutput, error)
  77. GetAuthorizationTokenRequest(*ecr.GetAuthorizationTokenInput) (*request.Request, *ecr.GetAuthorizationTokenOutput)
  78. GetAuthorizationToken(*ecr.GetAuthorizationTokenInput) (*ecr.GetAuthorizationTokenOutput, error)
  79. GetDownloadUrlForLayerRequest(*ecr.GetDownloadUrlForLayerInput) (*request.Request, *ecr.GetDownloadUrlForLayerOutput)
  80. GetDownloadUrlForLayer(*ecr.GetDownloadUrlForLayerInput) (*ecr.GetDownloadUrlForLayerOutput, error)
  81. GetRepositoryPolicyRequest(*ecr.GetRepositoryPolicyInput) (*request.Request, *ecr.GetRepositoryPolicyOutput)
  82. GetRepositoryPolicy(*ecr.GetRepositoryPolicyInput) (*ecr.GetRepositoryPolicyOutput, error)
  83. InitiateLayerUploadRequest(*ecr.InitiateLayerUploadInput) (*request.Request, *ecr.InitiateLayerUploadOutput)
  84. InitiateLayerUpload(*ecr.InitiateLayerUploadInput) (*ecr.InitiateLayerUploadOutput, error)
  85. ListImagesRequest(*ecr.ListImagesInput) (*request.Request, *ecr.ListImagesOutput)
  86. ListImages(*ecr.ListImagesInput) (*ecr.ListImagesOutput, error)
  87. PutImageRequest(*ecr.PutImageInput) (*request.Request, *ecr.PutImageOutput)
  88. PutImage(*ecr.PutImageInput) (*ecr.PutImageOutput, error)
  89. SetRepositoryPolicyRequest(*ecr.SetRepositoryPolicyInput) (*request.Request, *ecr.SetRepositoryPolicyOutput)
  90. SetRepositoryPolicy(*ecr.SetRepositoryPolicyInput) (*ecr.SetRepositoryPolicyOutput, error)
  91. UploadLayerPartRequest(*ecr.UploadLayerPartInput) (*request.Request, *ecr.UploadLayerPartOutput)
  92. UploadLayerPart(*ecr.UploadLayerPartInput) (*ecr.UploadLayerPartOutput, error)
  93. }
  94. var _ ECRAPI = (*ecr.ECR)(nil)