本文整理汇总了Golang中github.com/awslabs/aws-sdk-go/aws/awsutil.StringValue函数的典型用法代码示例。如果您正苦于以下问题:Golang StringValue函数的具体用法?Golang StringValue怎么用?Golang StringValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了StringValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleRoute53_UpdateHostedZoneComment
func ExampleRoute53_UpdateHostedZoneComment() {
svc := route53.New(nil)
params := &route53.UpdateHostedZoneCommentInput{
ID: aws.String("ResourceId"), // Required
Comment: aws.String("ResourceDescription"),
}
resp, err := svc.UpdateHostedZoneComment(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例2: ExampleElastiCache_DeleteReplicationGroup
func ExampleElastiCache_DeleteReplicationGroup() {
svc := elasticache.New(nil)
params := &elasticache.DeleteReplicationGroupInput{
ReplicationGroupID: aws.String("String"), // Required
FinalSnapshotIdentifier: aws.String("String"),
RetainPrimaryCluster: aws.Boolean(true),
}
resp, err := svc.DeleteReplicationGroup(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例3: ExampleElastiCache_ListTagsForResource
func ExampleElastiCache_ListTagsForResource() {
svc := elasticache.New(nil)
params := &elasticache.ListTagsForResourceInput{
ResourceName: aws.String("String"), // Required
}
resp, err := svc.ListTagsForResource(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例4: ExampleCloudFront_ListStreamingDistributions
func ExampleCloudFront_ListStreamingDistributions() {
svc := cloudfront.New(nil)
params := &cloudfront.ListStreamingDistributionsInput{
Marker: aws.String("string"),
MaxItems: aws.Long(1),
}
resp, err := svc.ListStreamingDistributions(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例5: ExampleCognitoSync_ListIdentityPoolUsage
func ExampleCognitoSync_ListIdentityPoolUsage() {
svc := cognitosync.New(nil)
params := &cognitosync.ListIdentityPoolUsageInput{
MaxResults: aws.Long(1),
NextToken: aws.String("String"),
}
resp, err := svc.ListIdentityPoolUsage(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例6: ExampleDirectConnect_DescribeVirtualInterfaces
func ExampleDirectConnect_DescribeVirtualInterfaces() {
svc := directconnect.New(nil)
params := &directconnect.DescribeVirtualInterfacesInput{
ConnectionID: aws.String("ConnectionId"),
VirtualInterfaceID: aws.String("VirtualInterfaceId"),
}
resp, err := svc.DescribeVirtualInterfaces(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例7: ExampleECS_ListTasks
func ExampleECS_ListTasks() {
svc := ecs.New(nil)
params := &ecs.ListTasksInput{
Cluster: aws.String("String"),
ContainerInstance: aws.String("String"),
Family: aws.String("String"),
MaxResults: aws.Long(1),
NextToken: aws.String("String"),
ServiceName: aws.String("String"),
StartedBy: aws.String("String"),
}
resp, err := svc.ListTasks(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例8: ExampleEMR_DescribeJobFlows
func ExampleEMR_DescribeJobFlows() {
svc := emr.New(nil)
params := &emr.DescribeJobFlowsInput{
CreatedAfter: aws.Time(time.Now()),
CreatedBefore: aws.Time(time.Now()),
JobFlowIDs: []*string{
aws.String("XmlString"), // Required
// More values...
},
JobFlowStates: []*string{
aws.String("JobFlowExecutionState"), // Required
// More values...
},
}
resp, err := svc.DescribeJobFlows(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例9: ExampleEMR_ListSteps
func ExampleEMR_ListSteps() {
svc := emr.New(nil)
params := &emr.ListStepsInput{
ClusterID: aws.String("ClusterId"), // Required
Marker: aws.String("Marker"),
StepIDs: []*string{
aws.String("XmlString"), // Required
// More values...
},
StepStates: []*string{
aws.String("StepState"), // Required
// More values...
},
}
resp, err := svc.ListSteps(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例10: ExampleElasticBeanstalk_UpdateApplicationVersion
func ExampleElasticBeanstalk_UpdateApplicationVersion() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.UpdateApplicationVersionInput{
ApplicationName: aws.String("ApplicationName"), // Required
VersionLabel: aws.String("VersionLabel"), // Required
Description: aws.String("Description"),
}
resp, err := svc.UpdateApplicationVersion(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例11: ExampleEMR_AddTags
func ExampleEMR_AddTags() {
svc := emr.New(nil)
params := &emr.AddTagsInput{
ResourceID: aws.String("ResourceId"), // Required
Tags: []*emr.Tag{ // Required
&emr.Tag{ // Required
Key: aws.String("String"),
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.AddTags(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例12: ExampleElasticBeanstalk_TerminateEnvironment
func ExampleElasticBeanstalk_TerminateEnvironment() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.TerminateEnvironmentInput{
EnvironmentID: aws.String("EnvironmentId"),
EnvironmentName: aws.String("EnvironmentName"),
TerminateResources: aws.Boolean(true),
}
resp, err := svc.TerminateEnvironment(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例13: ExampleElasticBeanstalk_CheckDNSAvailability
func ExampleElasticBeanstalk_CheckDNSAvailability() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.CheckDNSAvailabilityInput{
CNAMEPrefix: aws.String("DNSCnamePrefix"), // Required
}
resp, err := svc.CheckDNSAvailability(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例14: Exec
// Satisfies the Listener interface and calls the Lambda function
func (this *Lambda) Exec(evt event.Event) {
this.Log.Handler(this, &evt)
msg := magicString(this.Config.GetMessage(), evt)
reg := magicString(this.Config.GetRegion(), evt)
fun := magicString(this.Config.GetFunction(), evt)
svc := lambda.New(&aws.Config{Region: reg})
params := &lambda.InvokeInput{
FunctionName: aws.String(fun), // Required
Payload: []byte(msg),
}
resp, err := svc.Invoke(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
msg := fmt.Sprintf("%s %s", awsErr.Code(), awsErr.Message())
this.Log.HandlerError(this, msg, &evt)
if _, ok := err.(awserr.RequestFailure); ok {
}
} else {
this.Log.HandlerError(this, err.Error(), &evt)
}
return
}
this.Log.Debug("LAMBDA OUT %s %s \"%s\"", evt.GetId(), this.GetName(), awsutil.StringValue(resp))
}
示例15: ExampleDirectConnect_CreateInterconnect
func ExampleDirectConnect_CreateInterconnect() {
svc := directconnect.New(nil)
params := &directconnect.CreateInterconnectInput{
Bandwidth: aws.String("Bandwidth"), // Required
InterconnectName: aws.String("InterconnectName"), // Required
Location: aws.String("LocationCode"), // Required
}
resp, err := svc.CreateInterconnect(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 alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}