Vendor aws-sdk-go (dep ensure) (#178)

This commit is contained in:
Onur Filiz
2018-04-27 18:18:36 -07:00
committed by Robbie Zhang
parent 228a1f7a5f
commit 8d67098d06
2785 changed files with 1973570 additions and 25 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package dynamodbstreams provides the client and types for making API
// requests to Amazon DynamoDB Streams.
//
// Amazon DynamoDB Streams provides API actions for accessing streams and processing
// stream records. To learn more about application development with Streams,
// see Capturing Table Activity with DynamoDB Streams (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)
// in the Amazon DynamoDB Developer Guide.
//
// See https://docs.aws.amazon.com/goto/WebAPI/streams-dynamodb-2012-08-10 for more information on this service.
//
// See dynamodbstreams package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodbstreams/
//
// Using the Client
//
// To contact Amazon DynamoDB Streams 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.
//
// 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.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon DynamoDB Streams client DynamoDBStreams for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodbstreams/#New
package dynamodbstreams

View File

@@ -0,0 +1,80 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package dynamodbstreamsiface provides an interface to enable mocking the Amazon DynamoDB Streams service client
// for testing your code.
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters.
package dynamodbstreamsiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/dynamodbstreams"
)
// DynamoDBStreamsAPI provides an interface to enable mocking the
// dynamodbstreams.DynamoDBStreams service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// 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 SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon DynamoDB Streams.
// func myFunc(svc dynamodbstreamsiface.DynamoDBStreamsAPI) bool {
// // Make svc.DescribeStream request
// }
//
// func main() {
// sess := session.New()
// svc := dynamodbstreams.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockDynamoDBStreamsClient struct {
// dynamodbstreamsiface.DynamoDBStreamsAPI
// }
// func (m *mockDynamoDBStreamsClient) DescribeStream(input *dynamodbstreams.DescribeStreamInput) (*dynamodbstreams.DescribeStreamOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockDynamoDBStreamsClient{}
//
// myfunc(mockSvc)
//
// // Verify myFunc's functionality
// }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type DynamoDBStreamsAPI interface {
DescribeStream(*dynamodbstreams.DescribeStreamInput) (*dynamodbstreams.DescribeStreamOutput, error)
DescribeStreamWithContext(aws.Context, *dynamodbstreams.DescribeStreamInput, ...request.Option) (*dynamodbstreams.DescribeStreamOutput, error)
DescribeStreamRequest(*dynamodbstreams.DescribeStreamInput) (*request.Request, *dynamodbstreams.DescribeStreamOutput)
GetRecords(*dynamodbstreams.GetRecordsInput) (*dynamodbstreams.GetRecordsOutput, error)
GetRecordsWithContext(aws.Context, *dynamodbstreams.GetRecordsInput, ...request.Option) (*dynamodbstreams.GetRecordsOutput, error)
GetRecordsRequest(*dynamodbstreams.GetRecordsInput) (*request.Request, *dynamodbstreams.GetRecordsOutput)
GetShardIterator(*dynamodbstreams.GetShardIteratorInput) (*dynamodbstreams.GetShardIteratorOutput, error)
GetShardIteratorWithContext(aws.Context, *dynamodbstreams.GetShardIteratorInput, ...request.Option) (*dynamodbstreams.GetShardIteratorOutput, error)
GetShardIteratorRequest(*dynamodbstreams.GetShardIteratorInput) (*request.Request, *dynamodbstreams.GetShardIteratorOutput)
ListStreams(*dynamodbstreams.ListStreamsInput) (*dynamodbstreams.ListStreamsOutput, error)
ListStreamsWithContext(aws.Context, *dynamodbstreams.ListStreamsInput, ...request.Option) (*dynamodbstreams.ListStreamsOutput, error)
ListStreamsRequest(*dynamodbstreams.ListStreamsInput) (*request.Request, *dynamodbstreams.ListStreamsOutput)
}
var _ DynamoDBStreamsAPI = (*dynamodbstreams.DynamoDBStreams)(nil)

View File

@@ -0,0 +1,54 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package dynamodbstreams
const (
// ErrCodeExpiredIteratorException for service response error code
// "ExpiredIteratorException".
//
// The shard iterator has expired and can no longer be used to retrieve stream
// records. A shard iterator expires 15 minutes after it is retrieved using
// the GetShardIterator action.
ErrCodeExpiredIteratorException = "ExpiredIteratorException"
// ErrCodeInternalServerError for service response error code
// "InternalServerError".
//
// An error occurred on the server side.
ErrCodeInternalServerError = "InternalServerError"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries)
// in the Amazon DynamoDB Developer Guide.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The operation tried to access a nonexistent stream.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeTrimmedDataAccessException for service response error code
// "TrimmedDataAccessException".
//
// The operation attempted to read past the oldest stream record in a shard.
//
// In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records
// whose age exceeds this limit are subject to removal (trimming) from the stream.
// You might receive a TrimmedDataAccessException if:
//
// * You request a shard iterator with a sequence number older than the trim
// point (24 hours).
//
// * You obtain a shard iterator, but before you use the iterator in a GetRecords
// request, a stream record in the shard exceeds the 24 hour period and is
// trimmed. This causes the iterator to access a record that no longer exists.
ErrCodeTrimmedDataAccessException = "TrimmedDataAccessException"
)

View File

@@ -0,0 +1,159 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package dynamodbstreams_test
import (
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodbstreams"
)
var _ time.Duration
var _ strings.Reader
var _ aws.Config
func parseTime(layout, value string) *time.Time {
t, err := time.Parse(layout, value)
if err != nil {
panic(err)
}
return &t
}
// To describe a stream with a given stream ARN
//
// The following example describes a stream with a given stream ARN.
func ExampleDynamoDBStreams_DescribeStream_shared00() {
svc := dynamodbstreams.New(session.New())
input := &dynamodbstreams.DescribeStreamInput{
StreamArn: aws.String("arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"),
}
result, err := svc.DescribeStream(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case dynamodbstreams.ErrCodeResourceNotFoundException:
fmt.Println(dynamodbstreams.ErrCodeResourceNotFoundException, aerr.Error())
case dynamodbstreams.ErrCodeInternalServerError:
fmt.Println(dynamodbstreams.ErrCodeInternalServerError, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To retrieve all the stream records from a shard
//
// The following example retrieves all the stream records from a shard.
func ExampleDynamoDBStreams_GetRecords_shared00() {
svc := dynamodbstreams.New(session.New())
input := &dynamodbstreams.GetRecordsInput{
ShardIterator: aws.String("arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ... <remaining characters omitted> ..."),
}
result, err := svc.GetRecords(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case dynamodbstreams.ErrCodeResourceNotFoundException:
fmt.Println(dynamodbstreams.ErrCodeResourceNotFoundException, aerr.Error())
case dynamodbstreams.ErrCodeLimitExceededException:
fmt.Println(dynamodbstreams.ErrCodeLimitExceededException, aerr.Error())
case dynamodbstreams.ErrCodeInternalServerError:
fmt.Println(dynamodbstreams.ErrCodeInternalServerError, aerr.Error())
case dynamodbstreams.ErrCodeExpiredIteratorException:
fmt.Println(dynamodbstreams.ErrCodeExpiredIteratorException, aerr.Error())
case dynamodbstreams.ErrCodeTrimmedDataAccessException:
fmt.Println(dynamodbstreams.ErrCodeTrimmedDataAccessException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To obtain a shard iterator for the provided stream ARN and shard ID
//
// The following example returns a shard iterator for the provided stream ARN and shard
// ID.
func ExampleDynamoDBStreams_GetShardIterator_shared00() {
svc := dynamodbstreams.New(session.New())
input := &dynamodbstreams.GetShardIteratorInput{
ShardId: aws.String("00000001414576573621-f55eea83"),
ShardIteratorType: aws.String("TRIM_HORIZON"),
StreamArn: aws.String("arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"),
}
result, err := svc.GetShardIterator(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case dynamodbstreams.ErrCodeResourceNotFoundException:
fmt.Println(dynamodbstreams.ErrCodeResourceNotFoundException, aerr.Error())
case dynamodbstreams.ErrCodeInternalServerError:
fmt.Println(dynamodbstreams.ErrCodeInternalServerError, aerr.Error())
case dynamodbstreams.ErrCodeTrimmedDataAccessException:
fmt.Println(dynamodbstreams.ErrCodeTrimmedDataAccessException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To list all of the stream ARNs
//
// The following example lists all of the stream ARNs.
func ExampleDynamoDBStreams_ListStreams_shared00() {
svc := dynamodbstreams.New(session.New())
input := &dynamodbstreams.ListStreamsInput{}
result, err := svc.ListStreams(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case dynamodbstreams.ErrCodeResourceNotFoundException:
fmt.Println(dynamodbstreams.ErrCodeResourceNotFoundException, aerr.Error())
case dynamodbstreams.ErrCodeInternalServerError:
fmt.Println(dynamodbstreams.ErrCodeInternalServerError, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}

View File

@@ -0,0 +1,98 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package dynamodbstreams
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
// DynamoDBStreams provides the API operation methods for making requests to
// Amazon DynamoDB Streams. See this package's package overview docs
// for details on the service.
//
// DynamoDBStreams methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type DynamoDBStreams struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "streams.dynamodb" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the DynamoDBStreams client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a DynamoDBStreams client from just a session.
// svc := dynamodbstreams.New(mySession)
//
// // Create a DynamoDBStreams client with additional configuration
// svc := dynamodbstreams.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *DynamoDBStreams {
c := p.ClientConfig(EndpointsID, cfgs...)
if c.SigningNameDerived || len(c.SigningName) == 0 {
c.SigningName = "dynamodb"
}
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DynamoDBStreams {
svc := &DynamoDBStreams{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2012-08-10",
JSONVersion: "1.0",
TargetPrefix: "DynamoDBStreams_20120810",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a DynamoDBStreams operation and runs any
// custom request initialization.
func (c *DynamoDBStreams) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}