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 537055 additions and 189679 deletions
+153 -170
View File
@@ -16,19 +16,18 @@ const opAddPermission = "AddPermission"
// AddPermissionRequest generates a "aws/request.Request" representing the
// client's request for the AddPermission 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 AddPermission 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 AddPermission method directly
// instead.
// See AddPermission for more information on using the AddPermission
// 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 AddPermissionRequest method.
// req, resp := client.AddPermissionRequest(params)
@@ -120,19 +119,18 @@ const opChangeMessageVisibility = "ChangeMessageVisibility"
// ChangeMessageVisibilityRequest generates a "aws/request.Request" representing the
// client's request for the ChangeMessageVisibility 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 ChangeMessageVisibility 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 ChangeMessageVisibility method directly
// instead.
// See ChangeMessageVisibility for more information on using the ChangeMessageVisibility
// 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 ChangeMessageVisibilityRequest method.
// req, resp := client.ChangeMessageVisibilityRequest(params)
@@ -241,19 +239,18 @@ const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch"
// ChangeMessageVisibilityBatchRequest generates a "aws/request.Request" representing the
// client's request for the ChangeMessageVisibilityBatch 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 ChangeMessageVisibilityBatch 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 ChangeMessageVisibilityBatch method directly
// instead.
// See ChangeMessageVisibilityBatch for more information on using the ChangeMessageVisibilityBatch
// 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 ChangeMessageVisibilityBatchRequest method.
// req, resp := client.ChangeMessageVisibilityBatchRequest(params)
@@ -345,19 +342,18 @@ const opCreateQueue = "CreateQueue"
// CreateQueueRequest generates a "aws/request.Request" representing the
// client's request for the CreateQueue 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 CreateQueue 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 CreateQueue method directly
// instead.
// See CreateQueue for more information on using the CreateQueue
// 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 CreateQueueRequest method.
// req, resp := client.CreateQueueRequest(params)
@@ -470,19 +466,18 @@ const opDeleteMessage = "DeleteMessage"
// DeleteMessageRequest generates a "aws/request.Request" representing the
// client's request for the DeleteMessage 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 DeleteMessage 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 DeleteMessage method directly
// instead.
// See DeleteMessage for more information on using the DeleteMessage
// 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 DeleteMessageRequest method.
// req, resp := client.DeleteMessageRequest(params)
@@ -574,19 +569,18 @@ const opDeleteMessageBatch = "DeleteMessageBatch"
// DeleteMessageBatchRequest generates a "aws/request.Request" representing the
// client's request for the DeleteMessageBatch 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 DeleteMessageBatch 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 DeleteMessageBatch method directly
// instead.
// See DeleteMessageBatch for more information on using the DeleteMessageBatch
// 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 DeleteMessageBatchRequest method.
// req, resp := client.DeleteMessageBatchRequest(params)
@@ -677,19 +671,18 @@ const opDeleteQueue = "DeleteQueue"
// DeleteQueueRequest generates a "aws/request.Request" representing the
// client's request for the DeleteQueue 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 DeleteQueue 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 DeleteQueue method directly
// instead.
// See DeleteQueue for more information on using the DeleteQueue
// 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 DeleteQueueRequest method.
// req, resp := client.DeleteQueueRequest(params)
@@ -766,19 +759,18 @@ const opGetQueueAttributes = "GetQueueAttributes"
// GetQueueAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetQueueAttributes 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 GetQueueAttributes 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 GetQueueAttributes method directly
// instead.
// See GetQueueAttributes for more information on using the GetQueueAttributes
// 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 GetQueueAttributesRequest method.
// req, resp := client.GetQueueAttributesRequest(params)
@@ -857,19 +849,18 @@ const opGetQueueUrl = "GetQueueUrl"
// GetQueueUrlRequest generates a "aws/request.Request" representing the
// client's request for the GetQueueUrl 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 GetQueueUrl 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 GetQueueUrl method directly
// instead.
// See GetQueueUrl for more information on using the GetQueueUrl
// 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 GetQueueUrlRequest method.
// req, resp := client.GetQueueUrlRequest(params)
@@ -944,19 +935,18 @@ const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues"
// ListDeadLetterSourceQueuesRequest generates a "aws/request.Request" representing the
// client's request for the ListDeadLetterSourceQueues 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 ListDeadLetterSourceQueues 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 ListDeadLetterSourceQueues method directly
// instead.
// See ListDeadLetterSourceQueues for more information on using the ListDeadLetterSourceQueues
// 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 ListDeadLetterSourceQueuesRequest method.
// req, resp := client.ListDeadLetterSourceQueuesRequest(params)
@@ -1029,19 +1019,18 @@ const opListQueues = "ListQueues"
// ListQueuesRequest generates a "aws/request.Request" representing the
// client's request for the ListQueues 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 ListQueues 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 ListQueues method directly
// instead.
// See ListQueues for more information on using the ListQueues
// 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 ListQueuesRequest method.
// req, resp := client.ListQueuesRequest(params)
@@ -1106,19 +1095,18 @@ const opPurgeQueue = "PurgeQueue"
// PurgeQueueRequest generates a "aws/request.Request" representing the
// client's request for the PurgeQueue 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 PurgeQueue 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 PurgeQueue method directly
// instead.
// See PurgeQueue for more information on using the PurgeQueue
// 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 PurgeQueueRequest method.
// req, resp := client.PurgeQueueRequest(params)
@@ -1202,19 +1190,18 @@ const opReceiveMessage = "ReceiveMessage"
// ReceiveMessageRequest generates a "aws/request.Request" representing the
// client's request for the ReceiveMessage 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 ReceiveMessage 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 ReceiveMessage method directly
// instead.
// See ReceiveMessage for more information on using the ReceiveMessage
// 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 ReceiveMessageRequest method.
// req, resp := client.ReceiveMessageRequest(params)
@@ -1331,19 +1318,18 @@ const opRemovePermission = "RemovePermission"
// RemovePermissionRequest generates a "aws/request.Request" representing the
// client's request for the RemovePermission 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 RemovePermission 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 RemovePermission method directly
// instead.
// See RemovePermission for more information on using the RemovePermission
// 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 RemovePermissionRequest method.
// req, resp := client.RemovePermissionRequest(params)
@@ -1409,19 +1395,18 @@ const opSendMessage = "SendMessage"
// SendMessageRequest generates a "aws/request.Request" representing the
// client's request for the SendMessage 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 SendMessage 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 SendMessage method directly
// instead.
// See SendMessage for more information on using the SendMessage
// 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 SendMessageRequest method.
// req, resp := client.SendMessageRequest(params)
@@ -1500,19 +1485,18 @@ const opSendMessageBatch = "SendMessageBatch"
// SendMessageBatchRequest generates a "aws/request.Request" representing the
// client's request for the SendMessageBatch 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 SendMessageBatch 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 SendMessageBatch method directly
// instead.
// See SendMessageBatch for more information on using the SendMessageBatch
// 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 SendMessageBatchRequest method.
// req, resp := client.SendMessageBatchRequest(params)
@@ -1625,19 +1609,18 @@ const opSetQueueAttributes = "SetQueueAttributes"
// SetQueueAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetQueueAttributes 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 SetQueueAttributes 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 SetQueueAttributes method directly
// instead.
// See SetQueueAttributes for more information on using the SetQueueAttributes
// 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 SetQueueAttributesRequest method.
// req, resp := client.SetQueueAttributesRequest(params)
+9 -5
View File
@@ -5,8 +5,6 @@ package sqs_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/awstesting/unit"
"github.com/aws/aws-sdk-go/service/sqs"
@@ -24,7 +22,13 @@ func TestFlattenedTraits(t *testing.T) {
},
})
assert.Error(t, err)
assert.Equal(t, "InvalidAddress", err.Code())
assert.Equal(t, "The address QUEUE is not valid for this endpoint.", err.Message())
if err == nil {
t.Fatalf("expect error, got nil")
}
if e, a := "InvalidAddress", err.Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "The address QUEUE is not valid for this endpoint.", err.Message(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
+58 -21
View File
@@ -4,10 +4,9 @@ import (
"bytes"
"io/ioutil"
"net/http"
"strings"
"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"
@@ -36,7 +35,9 @@ func TestSendMessageChecksum(t *testing.T) {
}
})
err := req.Send()
assert.NoError(t, err)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestSendMessageChecksumInvalid(t *testing.T) {
@@ -52,10 +53,16 @@ func TestSendMessageChecksumInvalid(t *testing.T) {
}
})
err := req.Send()
assert.Error(t, err)
if err == nil {
t.Fatalf("expect error, got nil")
}
assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code())
assert.Contains(t, err.(awserr.Error).Message(), "expected MD5 checksum '000', got '098f6bcd4621d373cade4e832627b4f6'")
if e, a := "InvalidChecksum", err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := err.(awserr.Error).Message(), "expected MD5 checksum '000', got '098f6bcd4621d373cade4e832627b4f6'"; !strings.Contains(a, e) {
t.Errorf("expect %v to be in %v, was not", e, a)
}
}
func TestSendMessageChecksumInvalidNoValidation(t *testing.T) {
@@ -77,7 +84,9 @@ func TestSendMessageChecksumInvalidNoValidation(t *testing.T) {
}
})
err := req.Send()
assert.NoError(t, err)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestSendMessageChecksumNoInput(t *testing.T) {
@@ -88,10 +97,16 @@ func TestSendMessageChecksumNoInput(t *testing.T) {
r.Data = &sqs.SendMessageOutput{}
})
err := req.Send()
assert.Error(t, err)
if err == nil {
t.Fatalf("expect error, got nil")
}
assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code())
assert.Contains(t, err.(awserr.Error).Message(), "cannot compute checksum. missing body")
if e, a := "InvalidChecksum", err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := err.(awserr.Error).Message(), "cannot compute checksum. missing body"; !strings.Contains(a, e) {
t.Errorf("expect %v to be in %v, was not", e, a)
}
}
func TestSendMessageChecksumNoOutput(t *testing.T) {
@@ -104,10 +119,16 @@ func TestSendMessageChecksumNoOutput(t *testing.T) {
r.Data = &sqs.SendMessageOutput{}
})
err := req.Send()
assert.Error(t, err)
if err == nil {
t.Fatalf("expect error, got nil")
}
assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code())
assert.Contains(t, err.(awserr.Error).Message(), "cannot verify checksum. missing response MD5")
if e, a := "InvalidChecksum", err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := err.(awserr.Error).Message(), "cannot verify checksum. missing response MD5"; !strings.Contains(a, e) {
t.Errorf("expect %v to be in %v, was not", e, a)
}
}
func TestRecieveMessageChecksum(t *testing.T) {
@@ -126,7 +147,9 @@ func TestRecieveMessageChecksum(t *testing.T) {
}
})
err := req.Send()
assert.NoError(t, err)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestRecieveMessageChecksumInvalid(t *testing.T) {
@@ -146,10 +169,16 @@ func TestRecieveMessageChecksumInvalid(t *testing.T) {
}
})
err := req.Send()
assert.Error(t, err)
if err == nil {
t.Fatalf("expect error, got nil")
}
assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code())
assert.Contains(t, err.(awserr.Error).Message(), "invalid messages: 123, 456")
if e, a := "InvalidChecksum", err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := err.(awserr.Error).Message(), "invalid messages: 123, 456"; !strings.Contains(a, e) {
t.Errorf("expect %v to be in %v, was not", e, a)
}
}
func TestSendMessageBatchChecksum(t *testing.T) {
@@ -175,7 +204,9 @@ func TestSendMessageBatchChecksum(t *testing.T) {
}
})
err := req.Send()
assert.NoError(t, err)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestSendMessageBatchChecksumInvalid(t *testing.T) {
@@ -201,8 +232,14 @@ func TestSendMessageBatchChecksumInvalid(t *testing.T) {
}
})
err := req.Send()
assert.Error(t, err)
if err == nil {
t.Fatalf("expect error, got nil")
}
assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code())
assert.Contains(t, err.(awserr.Error).Message(), "invalid messages: 456, 789")
if e, a := "InvalidChecksum", err.(awserr.Error).Code(); e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := err.(awserr.Error).Message(), "invalid messages: 456, 789"; !strings.Contains(a, e) {
t.Errorf("expect %v to be in %v, was not", e, a)
}
}
+6 -58
View File
@@ -47,69 +47,17 @@
//
// Using the Client
//
// To use the client for Amazon Simple Queue Service you will first need
// to create a new instance of it.
// To Amazon Simple Queue Service 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 := sqs.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 Simple Queue Service client SQS 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/sqs/#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.AddPermission(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("AddPermission 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.AddPermissionWithContext(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 sqs
+1 -1
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 Simple Queue Service.