本文整理匯總了Golang中github.com/gunosy/aws-sdk-go/aws.String函數的典型用法代碼示例。如果您正苦於以下問題:Golang String函數的具體用法?Golang String怎麽用?Golang String使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了String函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ExampleRoute53_UpdateHealthCheck
func ExampleRoute53_UpdateHealthCheck() {
svc := route53.New(nil)
params := &route53.UpdateHealthCheckInput{
HealthCheckID: aws.String("HealthCheckId"), // Required
FailureThreshold: aws.Int64(1),
FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"),
HealthCheckVersion: aws.Int64(1),
IPAddress: aws.String("IPAddress"),
Port: aws.Int64(1),
ResourcePath: aws.String("ResourcePath"),
SearchString: aws.String("SearchString"),
}
resp, err := svc.UpdateHealthCheck(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))
}
示例2: ExampleCodePipeline_PutActionRevision
func ExampleCodePipeline_PutActionRevision() {
svc := codepipeline.New(nil)
params := &codepipeline.PutActionRevisionInput{
ActionName: aws.String("ActionName"), // Required
ActionRevision: &codepipeline.ActionRevision{ // Required
Created: aws.Time(time.Now()), // Required
RevisionID: aws.String("RevisionId"), // Required
RevisionChangeID: aws.String("RevisionChangeId"),
},
PipelineName: aws.String("PipelineName"), // Required
StageName: aws.String("StageName"), // Required
}
resp, err := svc.PutActionRevision(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))
}
示例3: ExampleRoute53Domains_CheckDomainAvailability
func ExampleRoute53Domains_CheckDomainAvailability() {
svc := route53domains.New(nil)
params := &route53domains.CheckDomainAvailabilityInput{
DomainName: aws.String("DomainName"), // Required
IDNLangCode: aws.String("LangCode"),
}
resp, err := svc.CheckDomainAvailability(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))
}
示例4: ExampleCloudSearch_UpdateServiceAccessPolicies
func ExampleCloudSearch_UpdateServiceAccessPolicies() {
svc := cloudsearch.New(nil)
params := &cloudsearch.UpdateServiceAccessPoliciesInput{
AccessPolicies: aws.String("PolicyDocument"), // Required
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.UpdateServiceAccessPolicies(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))
}
示例5: ExampleCodePipeline_ListActionTypes
func ExampleCodePipeline_ListActionTypes() {
svc := codepipeline.New(nil)
params := &codepipeline.ListActionTypesInput{
ActionOwnerFilter: aws.String("ActionOwner"),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListActionTypes(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))
}
示例6: ExampleEMR_RemoveTags
func ExampleEMR_RemoveTags() {
svc := emr.New(nil)
params := &emr.RemoveTagsInput{
ResourceID: aws.String("ResourceId"), // Required
TagKeys: []*string{ // Required
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.RemoveTags(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))
}
示例7: ExampleCloudSearch_DescribeSuggesters
func ExampleCloudSearch_DescribeSuggesters() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DescribeSuggestersInput{
DomainName: aws.String("DomainName"), // Required
Deployed: aws.Bool(true),
SuggesterNames: []*string{
aws.String("StandardName"), // Required
// More values...
},
}
resp, err := svc.DescribeSuggesters(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))
}
示例8: ExampleStorageGateway_CreateSnapshotFromVolumeRecoveryPoint
func ExampleStorageGateway_CreateSnapshotFromVolumeRecoveryPoint() {
svc := storagegateway.New(nil)
params := &storagegateway.CreateSnapshotFromVolumeRecoveryPointInput{
SnapshotDescription: aws.String("SnapshotDescription"), // Required
VolumeARN: aws.String("VolumeARN"), // Required
}
resp, err := svc.CreateSnapshotFromVolumeRecoveryPoint(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))
}
示例9: ExampleStorageGateway_CreateStorediSCSIVolume
func ExampleStorageGateway_CreateStorediSCSIVolume() {
svc := storagegateway.New(nil)
params := &storagegateway.CreateStorediSCSIVolumeInput{
DiskID: aws.String("DiskId"), // Required
GatewayARN: aws.String("GatewayARN"), // Required
NetworkInterfaceID: aws.String("NetworkInterfaceId"), // Required
PreserveExistingData: aws.Bool(true), // Required
TargetName: aws.String("TargetName"), // Required
SnapshotID: aws.String("SnapshotId"),
}
resp, err := svc.CreateStorediSCSIVolume(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))
}
示例10: ExampleCognitoIdentity_UnlinkIdentity
func ExampleCognitoIdentity_UnlinkIdentity() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.UnlinkIdentityInput{
IdentityID: aws.String("IdentityId"), // Required
Logins: map[string]*string{ // Required
"Key": aws.String("IdentityProviderToken"), // Required
// More values...
},
LoginsToRemove: []*string{ // Required
aws.String("IdentityProviderName"), // Required
// More values...
},
}
resp, err := svc.UnlinkIdentity(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))
}
示例11: ExampleStorageGateway_UpdateGatewayInformation
func ExampleStorageGateway_UpdateGatewayInformation() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateGatewayInformationInput{
GatewayARN: aws.String("GatewayARN"), // Required
GatewayName: aws.String("GatewayName"),
GatewayTimezone: aws.String("GatewayTimezone"),
}
resp, err := svc.UpdateGatewayInformation(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))
}
示例12: ExampleCognitoIdentity_UnlinkDeveloperIdentity
func ExampleCognitoIdentity_UnlinkDeveloperIdentity() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.UnlinkDeveloperIdentityInput{
DeveloperProviderName: aws.String("DeveloperProviderName"), // Required
DeveloperUserIdentifier: aws.String("DeveloperUserIdentifier"), // Required
IdentityID: aws.String("IdentityId"), // Required
IdentityPoolID: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.UnlinkDeveloperIdentity(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))
}
示例13: ExampleCognitoIdentity_ListIdentities
func ExampleCognitoIdentity_ListIdentities() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.ListIdentitiesInput{
IdentityPoolID: aws.String("IdentityPoolId"), // Required
MaxResults: aws.Int64(1), // Required
HideDisabled: aws.Bool(true),
NextToken: aws.String("PaginationKey"),
}
resp, err := svc.ListIdentities(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))
}
示例14: 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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例15: ExampleEMR_DescribeStep
func ExampleEMR_DescribeStep() {
svc := emr.New(nil)
params := &emr.DescribeStepInput{
ClusterID: aws.String("ClusterId"), // Required
StepID: aws.String("StepId"), // Required
}
resp, err := svc.DescribeStep(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))
}