Conver to regular Go vendor + dep tool

This commit is contained in:
Andrey Smirnov
2017-03-22 17:38:32 +03:00
parent 070347295e
commit c6c1012330
3260 changed files with 1742550 additions and 72 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,80 @@
// THIS FILE IS AUTOMATICALLY GENERATED. 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 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)
+54
View File
@@ -0,0 +1,54 @@
// THIS FILE IS AUTOMATICALLY GENERATED. 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"
)
@@ -0,0 +1,108 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package dynamodbstreams_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodbstreams"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleDynamoDBStreams_DescribeStream() {
sess := session.Must(session.NewSession())
svc := dynamodbstreams.New(sess)
params := &dynamodbstreams.DescribeStreamInput{
StreamArn: aws.String("StreamArn"), // Required
ExclusiveStartShardId: aws.String("ShardId"),
Limit: aws.Int64(1),
}
resp, err := svc.DescribeStream(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleDynamoDBStreams_GetRecords() {
sess := session.Must(session.NewSession())
svc := dynamodbstreams.New(sess)
params := &dynamodbstreams.GetRecordsInput{
ShardIterator: aws.String("ShardIterator"), // Required
Limit: aws.Int64(1),
}
resp, err := svc.GetRecords(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleDynamoDBStreams_GetShardIterator() {
sess := session.Must(session.NewSession())
svc := dynamodbstreams.New(sess)
params := &dynamodbstreams.GetShardIteratorInput{
ShardId: aws.String("ShardId"), // Required
ShardIteratorType: aws.String("ShardIteratorType"), // Required
StreamArn: aws.String("StreamArn"), // Required
SequenceNumber: aws.String("SequenceNumber"),
}
resp, err := svc.GetShardIterator(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleDynamoDBStreams_ListStreams() {
sess := session.Must(session.NewSession())
svc := dynamodbstreams.New(sess)
params := &dynamodbstreams.ListStreamsInput{
ExclusiveStartStreamArn: aws.String("StreamArn"),
Limit: aws.Int64(1),
TableName: aws.String("TableName"),
}
resp, err := svc.ListStreams(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
+99
View File
@@ -0,0 +1,99 @@
// THIS FILE IS AUTOMATICALLY GENERATED. 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"
)
// 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.
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/streams-dynamodb-2012-08-10
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...)
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 {
if len(signingName) == 0 {
signingName = "dynamodb"
}
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
}