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


Golang iot.New函數代碼示例

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


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


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