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

Golang iot.New函数代码示例

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

本文整理汇总了Golang中github.com/upstartmobile/aws-sdk-go/service/iot.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了New函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: init

func init() {
	Before("@iotdataplane", func() {
		svc := iot.New(nil)
		result, err := svc.DescribeEndpoint(&iot.DescribeEndpointInput{})
		if err != nil {
			World["error"] = err
			return
		}

		World["client"] = iotdataplane.New(aws.NewConfig().
			WithEndpoint(*result.EndpointAddress))
	})
}
开发者ID:nehadhamija,项目名称:aws-sdk-go,代码行数:13,代码来源:client.go


示例2: ExampleIoT_GetLoggingOptions

func ExampleIoT_GetLoggingOptions() {
	svc := iot.New(nil)

	var params *iot.GetLoggingOptionsInput
	resp, err := svc.GetLoggingOptions(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:nehadhamija,项目名称:aws-sdk-go,代码行数:16,代码来源:examples_test.go


示例3: ExampleIoT_DescribeEndpoint

func ExampleIoT_DescribeEndpoint() {
	svc := iot.New(nil)

	var params *iot.DescribeEndpointInput
	resp, err := svc.DescribeEndpoint(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:nehadhamija,项目名称:aws-sdk-go,代码行数:16,代码来源:examples_test.go


示例4: ExampleIoT_CancelCertificateTransfer

func ExampleIoT_CancelCertificateTransfer() {
	svc := iot.New(nil)

	params := &iot.CancelCertificateTransferInput{
		CertificateId: aws.String("CertificateId"), // Required
	}
	resp, err := svc.CancelCertificateTransfer(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:nehadhamija,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go


示例5: ExampleIoT_ListThingPrincipals

func ExampleIoT_ListThingPrincipals() {
	svc := iot.New(nil)

	params := &iot.ListThingPrincipalsInput{
		ThingName: aws.String("ThingName"), // Required
	}
	resp, err := svc.ListThingPrincipals(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:nehadhamija,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go


示例6: ExampleIoT_GetTopicRule

func ExampleIoT_GetTopicRule() {
	svc := iot.New(nil)

	params := &iot.GetTopicRuleInput{
		RuleName: aws.String("RuleName"), // Required
	}
	resp, err := svc.GetTopicRule(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:nehadhamija,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go


示例7: ExampleIoT_CreateKeysAndCertificate

func ExampleIoT_CreateKeysAndCertificate() {
	svc := iot.New(nil)

	params := &iot.CreateKeysAndCertificateInput{
		SetAsActive: aws.Bool(true),
	}
	resp, err := svc.CreateKeysAndCertificate(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:nehadhamija,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go


示例8: ExampleIoT_SetDefaultPolicyVersion

func ExampleIoT_SetDefaultPolicyVersion() {
	svc := iot.New(nil)

	params := &iot.SetDefaultPolicyVersionInput{
		PolicyName:      aws.String("PolicyName"),      // Required
		PolicyVersionId: aws.String("PolicyVersionId"), // Required
	}
	resp, err := svc.SetDefaultPolicyVersion(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:nehadhamija,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go


示例9: ExampleIoT_DetachPrincipalPolicy

func ExampleIoT_DetachPrincipalPolicy() {
	svc := iot.New(nil)

	params := &iot.DetachPrincipalPolicyInput{
		PolicyName: aws.String("PolicyName"), // Required
		Principal:  aws.String("Principal"),  // Required
	}
	resp, err := svc.DetachPrincipalPolicy(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:nehadhamija,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go


示例10: ExampleIoT_CreateCertificateFromCsr

func ExampleIoT_CreateCertificateFromCsr() {
	svc := iot.New(nil)

	params := &iot.CreateCertificateFromCsrInput{
		CertificateSigningRequest: aws.String("CertificateSigningRequest"), // Required
		SetAsActive:               aws.Bool(true),
	}
	resp, err := svc.CreateCertificateFromCsr(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:nehadhamija,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go


示例11: ExampleIoT_CreatePolicyVersion

func ExampleIoT_CreatePolicyVersion() {
	svc := iot.New(nil)

	params := &iot.CreatePolicyVersionInput{
		PolicyDocument: aws.String("PolicyDocument"), // Required
		PolicyName:     aws.String("PolicyName"),     // Required
		SetAsDefault:   aws.Bool(true),
	}
	resp, err := svc.CreatePolicyVersion(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:nehadhamija,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go


示例12: ExampleIoT_ListPrincipalThings

func ExampleIoT_ListPrincipalThings() {
	svc := iot.New(nil)

	params := &iot.ListPrincipalThingsInput{
		Principal:  aws.String("Principal"), // Required
		MaxResults: aws.Int64(1),
		NextToken:  aws.String("NextToken"),
	}
	resp, err := svc.ListPrincipalThings(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:nehadhamija,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go


示例13: ExampleIoT_ListPolicies

func ExampleIoT_ListPolicies() {
	svc := iot.New(nil)

	params := &iot.ListPoliciesInput{
		AscendingOrder: aws.Bool(true),
		Marker:         aws.String("Marker"),
		PageSize:       aws.Int64(1),
	}
	resp, err := svc.ListPolicies(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:nehadhamija,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go


示例14: ExampleIoT_SetLoggingOptions

func ExampleIoT_SetLoggingOptions() {
	svc := iot.New(nil)

	params := &iot.SetLoggingOptionsInput{
		LoggingOptionsPayload: &iot.LoggingOptionsPayload{
			RoleArn:  aws.String("AwsArn"), // Required
			LogLevel: aws.String("LogLevel"),
		},
	}
	resp, err := svc.SetLoggingOptions(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:nehadhamija,项目名称:aws-sdk-go,代码行数:21,代码来源:examples_test.go


示例15: ExampleIoT_ListTopicRules

func ExampleIoT_ListTopicRules() {
	svc := iot.New(nil)

	params := &iot.ListTopicRulesInput{
		MaxResults:   aws.Int64(1),
		NextToken:    aws.String("NextToken"),
		RuleDisabled: aws.Bool(true),
		Topic:        aws.String("Topic"),
	}
	resp, err := svc.ListTopicRules(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:nehadhamija,项目名称:aws-sdk-go,代码行数:21,代码来源:examples_test.go


示例16: ExampleIoT_ListThings

func ExampleIoT_ListThings() {
	svc := iot.New(nil)

	params := &iot.ListThingsInput{
		AttributeName:  aws.String("AttributeName"),
		AttributeValue: aws.String("AttributeValue"),
		MaxResults:     aws.Int64(1),
		NextToken:      aws.String("NextToken"),
	}
	resp, err := svc.ListThings(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:nehadhamija,项目名称:aws-sdk-go,代码行数:21,代码来源:examples_test.go


示例17: ExampleIoT_UpdateThing

func ExampleIoT_UpdateThing() {
	svc := iot.New(nil)

	params := &iot.UpdateThingInput{
		AttributePayload: &iot.AttributePayload{ // Required
			Attributes: map[string]*string{
				"Key": aws.String("AttributeValue"), // Required
				// More values...
			},
		},
		ThingName: aws.String("ThingName"), // Required
	}
	resp, err := svc.UpdateThing(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:nehadhamija,项目名称:aws-sdk-go,代码行数:24,代码来源:examples_test.go


示例18: TestInterface

func TestInterface(t *testing.T) {
	assert.Implements(t, (*iotiface.IoTAPI)(nil), iot.New(nil))
}
开发者ID:nehadhamija,项目名称:aws-sdk-go,代码行数:3,代码来源:interface_test.go


示例19: ExampleIoT_ReplaceTopicRule

func ExampleIoT_ReplaceTopicRule() {
	svc := iot.New(nil)

	params := &iot.ReplaceTopicRuleInput{
		RuleName: aws.String("RuleName"), // Required
		TopicRulePayload: &iot.TopicRulePayload{ // Required
			Actions: []*iot.Action{ // Required
				{ // Required
					DynamoDB: &iot.DynamoDBAction{
						HashKeyField:  aws.String("HashKeyField"),  // Required
						HashKeyValue:  aws.String("HashKeyValue"),  // Required
						RangeKeyField: aws.String("RangeKeyField"), // Required
						RangeKeyValue: aws.String("RangeKeyValue"), // Required
						RoleArn:       aws.String("AwsArn"),        // Required
						TableName:     aws.String("TableName"),     // Required
						PayloadField:  aws.String("PayloadField"),
					},
					Firehose: &iot.FirehoseAction{
						DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
						RoleArn:            aws.String("AwsArn"),             // Required
					},
					Kinesis: &iot.KinesisAction{
						RoleArn:      aws.String("AwsArn"),     // Required
						StreamName:   aws.String("StreamName"), // Required
						PartitionKey: aws.String("PartitionKey"),
					},
					Lambda: &iot.LambdaAction{
						FunctionArn: aws.String("FunctionArn"), // Required
					},
					Republish: &iot.RepublishAction{
						RoleArn: aws.String("AwsArn"),       // Required
						Topic:   aws.String("TopicPattern"), // Required
					},
					S3: &iot.S3Action{
						BucketName: aws.String("BucketName"), // Required
						Key:        aws.String("Key"),        // Required
						RoleArn:    aws.String("AwsArn"),     // Required
					},
					Sns: &iot.SnsAction{
						RoleArn:   aws.String("AwsArn"), // Required
						TargetArn: aws.String("AwsArn"), // Required
					},
					Sqs: &iot.SqsAction{
						QueueUrl:  aws.String("QueueUrl"), // Required
						RoleArn:   aws.String("AwsArn"),   // Required
						UseBase64: aws.Bool(true),
					},
				},
				// More values...
			},
			Sql:          aws.String("SQL"), // Required
			Description:  aws.String("Description"),
			RuleDisabled: aws.Bool(true),
		},
	}
	resp, err := svc.ReplaceTopicRule(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:nehadhamija,项目名称:aws-sdk-go,代码行数:67,代码来源:examples_test.go



注:本文中的github.com/upstartmobile/aws-sdk-go/service/iot.New函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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