vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood 2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537057 additions and 189681 deletions

View file

@ -16,19 +16,18 @@ const opBatchDeleteAttributes = "BatchDeleteAttributes"
// BatchDeleteAttributesRequest generates a "aws/request.Request" representing the
// client's request for the BatchDeleteAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See BatchDeleteAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the BatchDeleteAttributes method directly
// instead.
// See BatchDeleteAttributes for more information on using the BatchDeleteAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the BatchDeleteAttributesRequest method.
// req, resp := client.BatchDeleteAttributesRequest(params)
@ -113,19 +112,18 @@ const opBatchPutAttributes = "BatchPutAttributes"
// BatchPutAttributesRequest generates a "aws/request.Request" representing the
// client's request for the BatchPutAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See BatchPutAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the BatchPutAttributes method directly
// instead.
// See BatchPutAttributes for more information on using the BatchPutAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the BatchPutAttributesRequest method.
// req, resp := client.BatchPutAttributesRequest(params)
@ -258,19 +256,18 @@ const opCreateDomain = "CreateDomain"
// CreateDomainRequest generates a "aws/request.Request" representing the
// client's request for the CreateDomain operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See CreateDomain for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateDomain method directly
// instead.
// See CreateDomain for more information on using the CreateDomain
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateDomainRequest method.
// req, resp := client.CreateDomainRequest(params)
@ -351,19 +348,18 @@ const opDeleteAttributes = "DeleteAttributes"
// DeleteAttributesRequest generates a "aws/request.Request" representing the
// client's request for the DeleteAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DeleteAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteAttributes method directly
// instead.
// See DeleteAttributes for more information on using the DeleteAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteAttributesRequest method.
// req, resp := client.DeleteAttributesRequest(params)
@ -449,19 +445,18 @@ const opDeleteDomain = "DeleteDomain"
// DeleteDomainRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDomain operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DeleteDomain for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteDomain method directly
// instead.
// See DeleteDomain for more information on using the DeleteDomain
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteDomainRequest method.
// req, resp := client.DeleteDomainRequest(params)
@ -533,19 +528,18 @@ const opDomainMetadata = "DomainMetadata"
// DomainMetadataRequest generates a "aws/request.Request" representing the
// client's request for the DomainMetadata operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DomainMetadata for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DomainMetadata method directly
// instead.
// See DomainMetadata for more information on using the DomainMetadata
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DomainMetadataRequest method.
// req, resp := client.DomainMetadataRequest(params)
@ -615,19 +609,18 @@ const opGetAttributes = "GetAttributes"
// GetAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetAttributes method directly
// instead.
// See GetAttributes for more information on using the GetAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetAttributesRequest method.
// req, resp := client.GetAttributesRequest(params)
@ -707,19 +700,18 @@ const opListDomains = "ListDomains"
// ListDomainsRequest generates a "aws/request.Request" representing the
// client's request for the ListDomains operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListDomains for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListDomains method directly
// instead.
// See ListDomains for more information on using the ListDomains
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListDomainsRequest method.
// req, resp := client.ListDomainsRequest(params)
@ -848,19 +840,18 @@ const opPutAttributes = "PutAttributes"
// PutAttributesRequest generates a "aws/request.Request" representing the
// client's request for the PutAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See PutAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the PutAttributes method directly
// instead.
// See PutAttributes for more information on using the PutAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the PutAttributesRequest method.
// req, resp := client.PutAttributesRequest(params)
@ -975,19 +966,18 @@ const opSelect = "Select"
// SelectRequest generates a "aws/request.Request" representing the
// client's request for the Select operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See Select for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the Select method directly
// instead.
// See Select for more information on using the Select
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SelectRequest method.
// req, resp := client.SelectRequest(params)

View file

@ -24,69 +24,17 @@
//
// Using the Client
//
// To use the client for Amazon SimpleDB you will first need
// to create a new instance of it.
// To Amazon SimpleDB with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// When creating a client for an AWS service you'll first need to have a Session
// already created. The Session provides configuration that can be shared
// between multiple service clients. Additional configuration can be applied to
// the Session and service's client when they are constructed. The aws package's
// Config type contains several fields such as Region for the AWS Region the
// client should make API requests too. The optional Config value can be provided
// as the variadic argument for Sessions and client creation.
//
// Once the service's client is created you can use it to make API requests the
// AWS service. These clients are safe to use concurrently.
//
// // Create a session to share configuration, and load external configuration.
// sess := session.Must(session.NewSession())
//
// // Create the service's client with the session.
// svc := simpledb.New(sess)
//
// See the SDK's documentation for more information on how to use service clients.
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws package's Config type for more information on configuration options.
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon SimpleDB client SimpleDB for more
// information on creating the service's client.
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/simpledb/#New
//
// Once the client is created you can make an API request to the service.
// Each API method takes a input parameter, and returns the service response
// and an error.
//
// The API method will document which error codes the service can be returned
// by the operation if the service models the API operation's errors. These
// errors will also be available as const strings prefixed with "ErrCode".
//
// result, err := svc.BatchDeleteAttributes(params)
// if err != nil {
// // Cast err to awserr.Error to handle specific error codes.
// aerr, ok := err.(awserr.Error)
// if ok && aerr.Code() == <error code to check for> {
// // Specific error code handling
// }
// return err
// }
//
// fmt.Println("BatchDeleteAttributes result:")
// fmt.Println(result)
//
// Using the Client with Context
//
// The service's client also provides methods to make API requests with a Context
// value. This allows you to control the timeout, and cancellation of pending
// requests. These methods also take request Option as variadic parameter to apply
// additional configuration to the API request.
//
// ctx := context.Background()
//
// result, err := svc.BatchDeleteAttributesWithContext(ctx, params)
//
// See the request package documentation for more information on using Context pattern
// with the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
package simpledb

View file

@ -21,7 +21,7 @@ import (
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the the SDK's request pipeline.
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon SimpleDB.

View file

@ -1,7 +1,6 @@
package simpledb
import (
"github.com/stretchr/testify/assert"
"net/http"
"testing"
@ -27,7 +26,13 @@ func TestUnmarhsalErrorLeak(t *testing.T) {
reader := req.HTTPResponse.Body.(*awstesting.ReadCloser)
unmarshalError(req)
assert.NotNil(t, req.Error)
assert.Equal(t, reader.Closed, true)
assert.Equal(t, reader.Size, 0)
if req.Error == nil {
t.Errorf("expect error, got nil")
}
if !reader.Closed {
t.Errorf("expect closed, was not")
}
if e, a := 0, reader.Size; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}

View file

@ -6,8 +6,6 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
@ -45,9 +43,15 @@ func TestStatusCodeError(t *testing.T) {
DomainName: aws.String("test-domain"),
})
assert.Error(t, err)
assert.Equal(t, test.code, err.(awserr.Error).Code())
assert.Equal(t, test.message, err.(awserr.Error).Message())
if err == nil {
t.Fatalf("expect error, got nil")
}
if e, a := test.code, err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := test.message, err.(awserr.Error).Message(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
}
@ -111,12 +115,22 @@ func TestResponseError(t *testing.T) {
DomainName: aws.String("test-domain"),
})
assert.Error(t, err)
assert.Equal(t, test.code, err.(awserr.Error).Code())
assert.Equal(t, test.message, err.(awserr.Error).Message())
if err == nil {
t.Fatalf("expect error, got none")
}
if e, a := test.code, err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := test.message, err.(awserr.Error).Message(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if len(test.errors) > 0 {
assert.Equal(t, test.requestID, err.(awserr.RequestFailure).RequestID())
assert.Equal(t, test.scode, err.(awserr.RequestFailure).StatusCode())
if e, a := test.requestID, err.(awserr.RequestFailure).RequestID(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := test.scode, err.(awserr.RequestFailure).StatusCode(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
}
}