service.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elasticache
  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. // Amazon ElastiCache is a web service that makes it easier to set up, operate,
  13. // and scale a distributed cache in the cloud.
  14. //
  15. // With ElastiCache, customers gain all of the benefits of a high-performance,
  16. // in-memory cache with far less of the administrative burden of launching and
  17. // managing a distributed cache. The service makes setup, scaling, and cluster
  18. // failure handling much simpler than in a self-managed cache deployment.
  19. //
  20. // In addition, through integration with Amazon CloudWatch, customers get enhanced
  21. // visibility into the key performance statistics associated with their cache
  22. // and can receive alarms if a part of their cache runs hot.
  23. type ElastiCache struct {
  24. *service.Service
  25. }
  26. // Used for custom service initialization logic
  27. var initService func(*service.Service)
  28. // Used for custom request initialization logic
  29. var initRequest func(*request.Request)
  30. // New returns a new ElastiCache client.
  31. func New(config *aws.Config) *ElastiCache {
  32. service := &service.Service{
  33. ServiceInfo: serviceinfo.ServiceInfo{
  34. Config: defaults.DefaultConfig.Merge(config),
  35. ServiceName: "elasticache",
  36. APIVersion: "2015-02-02",
  37. },
  38. }
  39. service.Initialize()
  40. // Handlers
  41. service.Handlers.Sign.PushBack(v4.Sign)
  42. service.Handlers.Build.PushBack(query.Build)
  43. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  44. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  45. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  46. // Run custom service initialization if present
  47. if initService != nil {
  48. initService(service)
  49. }
  50. return &ElastiCache{service}
  51. }
  52. // newRequest creates a new request for a ElastiCache operation and runs any
  53. // custom request initialization.
  54. func (c *ElastiCache) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  55. req := c.NewRequest(op, params, data)
  56. // Run custom request initialization if present
  57. if initRequest != nil {
  58. initRequest(req)
  59. }
  60. return req
  61. }