當前位置: 首頁>>代碼示例>>Golang>>正文


Golang dynamodbstreams.New函數代碼示例

本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/dynamodbstreams.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了New函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ExampleDynamoDBStreams_ListStreams

func ExampleDynamoDBStreams_ListStreams() {
	svc := dynamodbstreams.New(nil)

	params := &dynamodbstreams.ListStreamsInput{
		ExclusiveStartStreamARN: aws.String("StreamArn"),
		Limit:     aws.Long(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.StringValue(resp))
}
開發者ID:rail,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:examples_test.go

示例2: ExampleDynamoDBStreams_GetShardIterator

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.StringValue(resp))
}
開發者ID:rail,項目名稱:aws-sdk-go,代碼行數:29,代碼來源:examples_test.go

示例3: ExampleDynamoDBStreams_ListStreams

func ExampleDynamoDBStreams_ListStreams() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	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)
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:26,代碼來源:examples_test.go

示例4: ExampleDynamoDBStreams_GetShardIterator

func ExampleDynamoDBStreams_GetShardIterator() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	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)
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:27,代碼來源:examples_test.go

示例5: ExampleDynamoDBStreams_GetRecords

func ExampleDynamoDBStreams_GetRecords() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	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)
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:25,代碼來源:examples_test.go

示例6: ExampleDynamoDBStreams_DescribeStream

func ExampleDynamoDBStreams_DescribeStream() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	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)
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:26,代碼來源:examples_test.go

示例7: init

func init() {
	Before("@dynamodbstreams", func() {
		World["client"] = dynamodbstreams.New(nil)
	})
}
開發者ID:skion,項目名稱:amazon-ecs-cli,代碼行數:5,代碼來源:client.go

示例8: init

func init() {
	gucumber.Before("@dynamodbstreams", func() {
		gucumber.World["client"] = dynamodbstreams.New(smoke.Session)
	})
}
開發者ID:ColourboxDevelopment,項目名稱:aws-sdk-go,代碼行數:5,代碼來源:client.go

示例9: TestInterface

func TestInterface(t *testing.T) {
	assert.Implements(t, (*dynamodbstreamsiface.DynamoDBStreamsAPI)(nil), dynamodbstreams.New(nil))
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:3,代碼來源:interface_test.go


注:本文中的github.com/aws/aws-sdk-go/service/dynamodbstreams.New函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。