service.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package glacier
  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/restjson"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // Amazon Glacier is a storage solution for "cold data."
  13. //
  14. // Amazon Glacier is an extremely low-cost storage service that provides secure,
  15. // durable, and easy-to-use storage for data backup and archival. With Amazon
  16. // Glacier, customers can store their data cost effectively for months, years,
  17. // or decades. Amazon Glacier also enables customers to offload the administrative
  18. // burdens of operating and scaling storage to AWS, so they don't have to worry
  19. // about capacity planning, hardware provisioning, data replication, hardware
  20. // failure and recovery, or time-consuming hardware migrations.
  21. //
  22. // Amazon Glacier is a great storage choice when low storage cost is paramount,
  23. // your data is rarely retrieved, and retrieval latency of several hours is
  24. // acceptable. If your application requires fast or frequent access to your
  25. // data, consider using Amazon S3. For more information, go to Amazon Simple
  26. // Storage Service (Amazon S3) (http://aws.amazon.com/s3/).
  27. //
  28. // You can store any kind of data in any format. There is no maximum limit
  29. // on the total amount of data you can store in Amazon Glacier.
  30. //
  31. // If you are a first-time user of Amazon Glacier, we recommend that you begin
  32. // by reading the following sections in the Amazon Glacier Developer Guide:
  33. //
  34. // What is Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html)
  35. // - This section of the Developer Guide describes the underlying data model,
  36. // the operations it supports, and the AWS SDKs that you can use to interact
  37. // with the service.
  38. //
  39. // Getting Started with Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-getting-started.html)
  40. // - The Getting Started section walks you through the process of creating a
  41. // vault, uploading archives, creating jobs to download archives, retrieving
  42. // the job output, and deleting archives.
  43. type Glacier struct {
  44. *service.Service
  45. }
  46. // Used for custom service initialization logic
  47. var initService func(*service.Service)
  48. // Used for custom request initialization logic
  49. var initRequest func(*request.Request)
  50. // New returns a new Glacier client.
  51. func New(config *aws.Config) *Glacier {
  52. service := &service.Service{
  53. ServiceInfo: serviceinfo.ServiceInfo{
  54. Config: defaults.DefaultConfig.Merge(config),
  55. ServiceName: "glacier",
  56. APIVersion: "2012-06-01",
  57. },
  58. }
  59. service.Initialize()
  60. // Handlers
  61. service.Handlers.Sign.PushBack(v4.Sign)
  62. service.Handlers.Build.PushBack(restjson.Build)
  63. service.Handlers.Unmarshal.PushBack(restjson.Unmarshal)
  64. service.Handlers.UnmarshalMeta.PushBack(restjson.UnmarshalMeta)
  65. service.Handlers.UnmarshalError.PushBack(restjson.UnmarshalError)
  66. // Run custom service initialization if present
  67. if initService != nil {
  68. initService(service)
  69. }
  70. return &Glacier{service}
  71. }
  72. // newRequest creates a new request for a Glacier operation and runs any
  73. // custom request initialization.
  74. func (c *Glacier) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  75. req := c.NewRequest(op, params, data)
  76. // Run custom request initialization if present
  77. if initRequest != nil {
  78. initRequest(req)
  79. }
  80. return req
  81. }