Example #1
0
func ExampleDynamoDBStreams_GetShardIterator() {
	svc := dynamodbstreams.New(nil)

	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 {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Example #2
0
func ExampleDynamoDBStreams_ListStreams() {
	svc := dynamodbstreams.New(nil)

	params := &dynamodbstreams.ListStreamsInput{
		ExclusiveStartStreamArn: aws.String("StreamArn"),
		Limit:     aws.Int64(1),
		TableName: aws.String("TableName"),
	}
	resp, err := svc.ListStreams(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
Example #3
0
func TestInterface(t *testing.T) {
	assert.Implements(t, (*dynamodbstreamsiface.DynamoDBStreamsAPI)(nil), dynamodbstreams.New(nil))
}
Example #4
0
func init() {
	Before("@dynamodbstreams", func() {
		World["client"] = dynamodbstreams.New(nil)
	})
}