service.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elb
  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. // Elastic Load Balancing distributes incoming traffic across your EC2 instances.
  13. //
  14. // For information about the features of Elastic Load Balancing, see What Is
  15. // Elastic Load Balancing? (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elastic-load-balancing.html)
  16. // in the Elastic Load Balancing Developer Guide.
  17. //
  18. // For information about the AWS regions supported by Elastic Load Balancing,
  19. // see Regions and Endpoints - Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region)
  20. // in the Amazon Web Services General Reference.
  21. //
  22. // All Elastic Load Balancing operations are idempotent, which means that they
  23. // complete at most one time. If you repeat an operation, it succeeds with a
  24. // 200 OK response code.
  25. type ELB struct {
  26. *service.Service
  27. }
  28. // Used for custom service initialization logic
  29. var initService func(*service.Service)
  30. // Used for custom request initialization logic
  31. var initRequest func(*request.Request)
  32. // New returns a new ELB client.
  33. func New(config *aws.Config) *ELB {
  34. service := &service.Service{
  35. ServiceInfo: serviceinfo.ServiceInfo{
  36. Config: defaults.DefaultConfig.Merge(config),
  37. ServiceName: "elasticloadbalancing",
  38. APIVersion: "2012-06-01",
  39. },
  40. }
  41. service.Initialize()
  42. // Handlers
  43. service.Handlers.Sign.PushBack(v4.Sign)
  44. service.Handlers.Build.PushBack(query.Build)
  45. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  46. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  47. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  48. // Run custom service initialization if present
  49. if initService != nil {
  50. initService(service)
  51. }
  52. return &ELB{service}
  53. }
  54. // newRequest creates a new request for a ELB operation and runs any
  55. // custom request initialization.
  56. func (c *ELB) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  57. req := c.NewRequest(op, params, data)
  58. // Run custom request initialization if present
  59. if initRequest != nil {
  60. initRequest(req)
  61. }
  62. return req
  63. }