service.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package sqs
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/defaults"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/aws/service"
  8. "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
  9. "github.com/aws/aws-sdk-go/internal/protocol/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // Welcome to the Amazon Simple Queue Service API Reference. This section describes
  13. // who should read this guide, how the guide is organized, and other resources
  14. // related to the Amazon Simple Queue Service (Amazon SQS).
  15. //
  16. // Amazon SQS offers reliable and scalable hosted queues for storing messages
  17. // as they travel between computers. By using Amazon SQS, you can move data
  18. // between distributed components of your applications that perform different
  19. // tasks without losing messages or requiring each component to be always available.
  20. //
  21. // Helpful Links: Current WSDL (2012-11-05) (http://queue.amazonaws.com/doc/2012-11-05/QueueService.wsdl)
  22. // Making API Requests (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MakingRequestsArticle.html)
  23. // Amazon SQS product page (http://aws.amazon.com/sqs/) Using Amazon SQS Message
  24. // Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html)
  25. // Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html)
  26. // Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region)
  27. //
  28. //
  29. // We also provide SDKs that enable you to access Amazon SQS from your preferred
  30. // programming language. The SDKs contain functionality that automatically takes
  31. // care of tasks such as:
  32. //
  33. // Cryptographically signing your service requests Retrying requests Handling
  34. // error responses
  35. //
  36. // For a list of available SDKs, go to Tools for Amazon Web Services (http://aws.amazon.com/tools/).
  37. type SQS struct {
  38. *service.Service
  39. }
  40. // Used for custom service initialization logic
  41. var initService func(*service.Service)
  42. // Used for custom request initialization logic
  43. var initRequest func(*request.Request)
  44. // New returns a new SQS client.
  45. func New(config *aws.Config) *SQS {
  46. service := &service.Service{
  47. ServiceInfo: serviceinfo.ServiceInfo{
  48. Config: defaults.DefaultConfig.Merge(config),
  49. ServiceName: "sqs",
  50. APIVersion: "2012-11-05",
  51. },
  52. }
  53. service.Initialize()
  54. // Handlers
  55. service.Handlers.Sign.PushBack(v4.Sign)
  56. service.Handlers.Build.PushBack(query.Build)
  57. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  58. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  59. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  60. // Run custom service initialization if present
  61. if initService != nil {
  62. initService(service)
  63. }
  64. return &SQS{service}
  65. }
  66. // newRequest creates a new request for a SQS operation and runs any
  67. // custom request initialization.
  68. func (c *SQS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  69. req := c.NewRequest(op, params, data)
  70. // Run custom request initialization if present
  71. if initRequest != nil {
  72. initRequest(req)
  73. }
  74. return req
  75. }