aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/aws/aws-sdk-go/service/s3/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/service/s3/service.go')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/service/s3/service.go93
1 files changed, 93 insertions, 0 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go
new file mode 100644
index 0000000..614e477
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go
@@ -0,0 +1,93 @@
1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package s3
4
5import (
6 "github.com/aws/aws-sdk-go/aws"
7 "github.com/aws/aws-sdk-go/aws/client"
8 "github.com/aws/aws-sdk-go/aws/client/metadata"
9 "github.com/aws/aws-sdk-go/aws/request"
10 "github.com/aws/aws-sdk-go/aws/signer/v4"
11 "github.com/aws/aws-sdk-go/private/protocol/restxml"
12)
13
14// S3 provides the API operation methods for making requests to
15// Amazon Simple Storage Service. See this package's package overview docs
16// for details on the service.
17//
18// S3 methods are safe to use concurrently. It is not safe to
19// modify mutate any of the struct's properties though.
20type S3 struct {
21 *client.Client
22}
23
24// Used for custom client initialization logic
25var initClient func(*client.Client)
26
27// Used for custom request initialization logic
28var initRequest func(*request.Request)
29
30// Service information constants
31const (
32 ServiceName = "s3" // Service endpoint prefix API calls made to.
33 EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
34)
35
36// New creates a new instance of the S3 client with a session.
37// If additional configuration is needed for the client instance use the optional
38// aws.Config parameter to add your extra config.
39//
40// Example:
41// // Create a S3 client from just a session.
42// svc := s3.New(mySession)
43//
44// // Create a S3 client with additional configuration
45// svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
46func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 {
47 c := p.ClientConfig(EndpointsID, cfgs...)
48 return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
49}
50
51// newClient creates, initializes and returns a new service client instance.
52func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3 {
53 svc := &S3{
54 Client: client.New(
55 cfg,
56 metadata.ClientInfo{
57 ServiceName: ServiceName,
58 SigningName: signingName,
59 SigningRegion: signingRegion,
60 Endpoint: endpoint,
61 APIVersion: "2006-03-01",
62 },
63 handlers,
64 ),
65 }
66
67 // Handlers
68 svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
69 svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
70 svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
71 svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
72 svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
73
74 // Run custom client initialization if present
75 if initClient != nil {
76 initClient(svc.Client)
77 }
78
79 return svc
80}
81
82// newRequest creates a new request for a S3 operation and runs any
83// custom request initialization.
84func (c *S3) newRequest(op *request.Operation, params, data interface{}) *request.Request {
85 req := c.NewRequest(op, params, data)
86
87 // Run custom request initialization if present
88 if initRequest != nil {
89 initRequest(req)
90 }
91
92 return req
93}