• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang dynamodbstreams.New函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang ec2.New函数代码示例发布时间:2022-05-24
下一篇:
Golang dynamodbattribute.ConvertToMap函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap