本文整理汇总了Golang中github.com/tetrafolium/aws-sdk-go/aws/awsutil.Prettify函数的典型用法代码示例。如果您正苦于以下问题:Golang Prettify函数的具体用法?Golang Prettify怎么用?Golang Prettify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Prettify函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: compareObjects
func compareObjects(t *testing.T, expected interface{}, actual interface{}) {
if !reflect.DeepEqual(expected, actual) {
t.Errorf("\nExpected %s:\n%s\nActual %s:\n%s\n",
reflect.ValueOf(expected).Kind(),
awsutil.Prettify(expected),
reflect.ValueOf(actual).Kind(),
awsutil.Prettify(actual))
}
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:9,代码来源:converter_test.go
示例2: ExampleCloudSearchDomain_UploadDocuments
func ExampleCloudSearchDomain_UploadDocuments() {
svc := cloudsearchdomain.New(nil)
params := &cloudsearchdomain.UploadDocumentsInput{
ContentType: aws.String("ContentType"), // Required
Documents: bytes.NewReader([]byte("PAYLOAD")), // Required
}
resp, err := svc.UploadDocuments(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go
示例3: ExampleCloudHSM_CreateHsm
func ExampleCloudHSM_CreateHsm() {
svc := cloudhsm.New(nil)
params := &cloudhsm.CreateHsmInput{
IamRoleArn: aws.String("IamRoleArn"), // Required
SshKey: aws.String("SshKey"), // Required
SubnetId: aws.String("SubnetId"), // Required
SubscriptionType: aws.String("SubscriptionType"), // Required
ClientToken: aws.String("ClientToken"),
EniIp: aws.String("IpAddress"),
ExternalId: aws.String("ExternalId"),
SyslogIp: aws.String("IpAddress"),
}
resp, err := svc.CreateHsm(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:33,代码来源:examples_test.go
示例4: ExampleCloudHSM_ListHsms
func ExampleCloudHSM_ListHsms() {
svc := cloudhsm.New(nil)
params := &cloudhsm.ListHsmsInput{
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.ListHsms(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例5: ExampleCloudFormation_ValidateTemplate
func ExampleCloudFormation_ValidateTemplate() {
svc := cloudformation.New(nil)
params := &cloudformation.ValidateTemplateInput{
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
}
resp, err := svc.ValidateTemplate(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go
示例6: ExampleCloudFormation_EstimateTemplateCost
func ExampleCloudFormation_EstimateTemplateCost() {
svc := cloudformation.New(nil)
params := &cloudformation.EstimateTemplateCostInput{
Parameters: []*cloudformation.Parameter{
{ // Required
ParameterKey: aws.String("ParameterKey"),
ParameterValue: aws.String("ParameterValue"),
UsePreviousValue: aws.Bool(true),
},
// More values...
},
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
}
resp, err := svc.EstimateTemplateCost(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:35,代码来源:examples_test.go
示例7: ExampleSNS_Unsubscribe
func ExampleSNS_Unsubscribe() {
svc := sns.New(nil)
params := &sns.UnsubscribeInput{
SubscriptionArn: aws.String("subscriptionARN"), // Required
}
resp, err := svc.Unsubscribe(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例8: ExampleWorkSpaces_DescribeWorkspaceDirectories
func ExampleWorkSpaces_DescribeWorkspaceDirectories() {
svc := workspaces.New(nil)
params := &workspaces.DescribeWorkspaceDirectoriesInput{
DirectoryIds: []*string{
aws.String("DirectoryId"), // Required
// More values...
},
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.DescribeWorkspaceDirectories(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例9: ExampleRoute53_GetHealthCheckLastFailureReason
func ExampleRoute53_GetHealthCheckLastFailureReason() {
svc := route53.New(nil)
params := &route53.GetHealthCheckLastFailureReasonInput{
HealthCheckId: aws.String("HealthCheckId"), // Required
}
resp, err := svc.GetHealthCheckLastFailureReason(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例10: ExampleConfigService_DescribeConfigurationRecorderStatus
func ExampleConfigService_DescribeConfigurationRecorderStatus() {
svc := configservice.New(nil)
params := &configservice.DescribeConfigurationRecorderStatusInput{
ConfigurationRecorderNames: []*string{
aws.String("RecorderName"), // Required
// More values...
},
}
resp, err := svc.DescribeConfigurationRecorderStatus(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go
示例11: ExampleConfigService_PutDeliveryChannel
func ExampleConfigService_PutDeliveryChannel() {
svc := configservice.New(nil)
params := &configservice.PutDeliveryChannelInput{
DeliveryChannel: &configservice.DeliveryChannel{ // Required
Name: aws.String("ChannelName"),
S3BucketName: aws.String("String"),
S3KeyPrefix: aws.String("String"),
SnsTopicARN: aws.String("String"),
},
}
resp, err := svc.PutDeliveryChannel(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go
示例12: ExampleConfigService_GetResourceConfigHistory
func ExampleConfigService_GetResourceConfigHistory() {
svc := configservice.New(nil)
params := &configservice.GetResourceConfigHistoryInput{
ResourceId: aws.String("ResourceId"), // Required
ResourceType: aws.String("ResourceType"), // Required
ChronologicalOrder: aws.String("ChronologicalOrder"),
EarlierTime: aws.Time(time.Now()),
LaterTime: aws.Time(time.Now()),
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.GetResourceConfigHistory(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go
示例13: ExampleDynamoDB_ListTables
func ExampleDynamoDB_ListTables() {
svc := dynamodb.New(nil)
params := &dynamodb.ListTablesInput{
ExclusiveStartTableName: aws.String("TableName"),
Limit: aws.Int64(1),
}
resp, err := svc.ListTables(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go
示例14: ExampleSTS_AssumeRoleWithWebIdentity
func ExampleSTS_AssumeRoleWithWebIdentity() {
svc := sts.New(nil)
params := &sts.AssumeRoleWithWebIdentityInput{
RoleArn: aws.String("arnType"), // Required
RoleSessionName: aws.String("userNameType"), // Required
WebIdentityToken: aws.String("clientTokenType"), // Required
DurationSeconds: aws.Int64(1),
Policy: aws.String("sessionPolicyDocumentType"),
ProviderId: aws.String("urlType"),
}
resp, err := svc.AssumeRoleWithWebIdentity(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go
示例15: ExampleSTS_GetSessionToken
func ExampleSTS_GetSessionToken() {
svc := sts.New(nil)
params := &sts.GetSessionTokenInput{
DurationSeconds: aws.Int64(1),
SerialNumber: aws.String("serialNumberType"),
TokenCode: aws.String("tokenCodeType"),
}
resp, err := svc.GetSessionToken(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例16: ExampleCloudWatchLogs_TestMetricFilter
func ExampleCloudWatchLogs_TestMetricFilter() {
svc := cloudwatchlogs.New(nil)
params := &cloudwatchlogs.TestMetricFilterInput{
FilterPattern: aws.String("FilterPattern"), // Required
LogEventMessages: []*string{ // Required
aws.String("EventMessage"), // Required
// More values...
},
}
resp, err := svc.TestMetricFilter(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例17: ExampleCloudWatchLogs_DeleteDestination
func ExampleCloudWatchLogs_DeleteDestination() {
svc := cloudwatchlogs.New(nil)
params := &cloudwatchlogs.DeleteDestinationInput{
DestinationName: aws.String("DestinationName"), // Required
}
resp, err := svc.DeleteDestination(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例18: ExampleRoute53_ListResourceRecordSets
func ExampleRoute53_ListResourceRecordSets() {
svc := route53.New(nil)
params := &route53.ListResourceRecordSetsInput{
HostedZoneId: aws.String("ResourceId"), // Required
MaxItems: aws.String("PageMaxItems"),
StartRecordIdentifier: aws.String("ResourceRecordSetIdentifier"),
StartRecordName: aws.String("DNSName"),
StartRecordType: aws.String("RRType"),
}
resp, err := svc.ListResourceRecordSets(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例19: ExampleSNS_AddPermission
func ExampleSNS_AddPermission() {
svc := sns.New(nil)
params := &sns.AddPermissionInput{
AWSAccountId: []*string{ // Required
aws.String("delegate"), // Required
// More values...
},
ActionName: []*string{ // Required
aws.String("action"), // Required
// More values...
},
Label: aws.String("label"), // Required
TopicArn: aws.String("topicARN"), // Required
}
resp, err := svc.AddPermission(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:35,代码来源:examples_test.go
示例20: ExampleRoute53_ListReusableDelegationSets
func ExampleRoute53_ListReusableDelegationSets() {
svc := route53.New(nil)
params := &route53.ListReusableDelegationSetsInput{
Marker: aws.String("PageMarker"),
MaxItems: aws.String("PageMaxItems"),
}
resp, err := svc.ListReusableDelegationSets(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))
}
开发者ID:tetrafolium,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go
注:本文中的github.com/tetrafolium/aws-sdk-go/aws/awsutil.Prettify函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论