本文整理汇总了Golang中github.com/upstartmobile/aws-sdk-go/aws.String函数的典型用法代码示例。如果您正苦于以下问题:Golang String函数的具体用法?Golang String怎么用?Golang String使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了String函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleSQS_ReceiveMessage
func ExampleSQS_ReceiveMessage() {
svc := sqs.New(nil)
params := &sqs.ReceiveMessageInput{
QueueUrl: aws.String("String"), // Required
AttributeNames: []*string{
aws.String("QueueAttributeName"), // Required
// More values...
},
MaxNumberOfMessages: aws.Int64(1),
MessageAttributeNames: []*string{
aws.String("MessageAttributeName"), // Required
// More values...
},
VisibilityTimeout: aws.Int64(1),
WaitTimeSeconds: aws.Int64(1),
}
resp, err := svc.ReceiveMessage(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)
}
示例2: ExampleWorkSpaces_DescribeWorkspaces
func ExampleWorkSpaces_DescribeWorkspaces() {
svc := workspaces.New(nil)
params := &workspaces.DescribeWorkspacesInput{
BundleId: aws.String("BundleId"),
DirectoryId: aws.String("DirectoryId"),
Limit: aws.Int64(1),
NextToken: aws.String("PaginationToken"),
UserName: aws.String("UserName"),
WorkspaceIds: []*string{
aws.String("WorkspaceId"), // Required
// More values...
},
}
resp, err := svc.DescribeWorkspaces(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)
}
示例3: ExampleGlacier_SetVaultNotifications
func ExampleGlacier_SetVaultNotifications() {
svc := glacier.New(nil)
params := &glacier.SetVaultNotificationsInput{
AccountId: aws.String("string"), // Required
VaultName: aws.String("string"), // Required
VaultNotificationConfig: &glacier.VaultNotificationConfig{
Events: []*string{
aws.String("string"), // Required
// More values...
},
SNSTopic: aws.String("string"),
},
}
resp, err := svc.SetVaultNotifications(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)
}
示例4: ExampleCloudSearch_DefineSuggester
func ExampleCloudSearch_DefineSuggester() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DefineSuggesterInput{
DomainName: aws.String("DomainName"), // Required
Suggester: &cloudsearch.Suggester{ // Required
DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
SourceField: aws.String("FieldName"), // Required
FuzzyMatching: aws.String("SuggesterFuzzyMatching"),
SortExpression: aws.String("String"),
},
SuggesterName: aws.String("StandardName"), // Required
},
}
resp, err := svc.DefineSuggester(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)
}
示例5: ExampleElastiCache_ResetCacheParameterGroup
func ExampleElastiCache_ResetCacheParameterGroup() {
svc := elasticache.New(nil)
params := &elasticache.ResetCacheParameterGroupInput{
CacheParameterGroupName: aws.String("String"), // Required
ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
{ // Required
ParameterName: aws.String("String"),
ParameterValue: aws.String("String"),
},
// More values...
},
ResetAllParameters: aws.Bool(true),
}
resp, err := svc.ResetCacheParameterGroup(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)
}
示例6: ExampleELB_CreateLoadBalancerListeners
func ExampleELB_CreateLoadBalancerListeners() {
svc := elb.New(nil)
params := &elb.CreateLoadBalancerListenersInput{
Listeners: []*elb.Listener{ // Required
{ // Required
InstancePort: aws.Int64(1), // Required
LoadBalancerPort: aws.Int64(1), // Required
Protocol: aws.String("Protocol"), // Required
InstanceProtocol: aws.String("Protocol"),
SSLCertificateId: aws.String("SSLCertificateId"),
},
// More values...
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.CreateLoadBalancerListeners(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)
}
示例7: ExampleELB_RemoveTags
func ExampleELB_RemoveTags() {
svc := elb.New(nil)
params := &elb.RemoveTagsInput{
LoadBalancerNames: []*string{ // Required
aws.String("AccessPointName"), // Required
// More values...
},
Tags: []*elb.TagKeyOnly{ // Required
{ // Required
Key: aws.String("TagKey"),
},
// More values...
},
}
resp, err := svc.RemoveTags(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)
}
示例8: ExampleRoute53Domains_UpdateTagsForDomain
func ExampleRoute53Domains_UpdateTagsForDomain() {
svc := route53domains.New(nil)
params := &route53domains.UpdateTagsForDomainInput{
DomainName: aws.String("DomainName"), // Required
TagsToUpdate: []*route53domains.Tag{
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
}
resp, err := svc.UpdateTagsForDomain(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)
}
示例9: ExampleCloudWatchLogs_FilterLogEvents
func ExampleCloudWatchLogs_FilterLogEvents() {
svc := cloudwatchlogs.New(nil)
params := &cloudwatchlogs.FilterLogEventsInput{
LogGroupName: aws.String("LogGroupName"), // Required
EndTime: aws.Int64(1),
FilterPattern: aws.String("FilterPattern"),
Interleaved: aws.Bool(true),
Limit: aws.Int64(1),
LogStreamNames: []*string{
aws.String("LogStreamName"), // Required
// More values...
},
NextToken: aws.String("NextToken"),
StartTime: aws.Int64(1),
}
resp, err := svc.FilterLogEvents(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)
}
示例10: ExampleStorageGateway_AddTagsToResource
func ExampleStorageGateway_AddTagsToResource() {
svc := storagegateway.New(nil)
params := &storagegateway.AddTagsToResourceInput{
ResourceARN: aws.String("ResourceARN"), // Required
Tags: []*storagegateway.Tag{ // Required
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
}
resp, err := svc.AddTagsToResource(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)
}
示例11: ExampleRoute53Domains_UpdateDomainNameservers
func ExampleRoute53Domains_UpdateDomainNameservers() {
svc := route53domains.New(nil)
params := &route53domains.UpdateDomainNameserversInput{
DomainName: aws.String("DomainName"), // Required
Nameservers: []*route53domains.Nameserver{ // Required
{ // Required
Name: aws.String("HostName"), // Required
GlueIps: []*string{
aws.String("GlueIp"), // Required
// More values...
},
},
// More values...
},
FIAuthKey: aws.String("FIAuthKey"),
}
resp, err := svc.UpdateDomainNameservers(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)
}
示例12: Retrieve
// Retrieve generates a new set of temporary credentials using STS.
func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
// Apply defaults where parameters are not set.
if p.Client == nil {
p.Client = sts.New(nil)
}
if p.RoleSessionName == "" {
// Try to work out a role name that will hopefully end up unique.
p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano())
}
if p.Duration == 0 {
// Expire as often as AWS permits.
p.Duration = 15 * time.Minute
}
roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{
DurationSeconds: aws.Int64(int64(p.Duration / time.Second)),
RoleArn: aws.String(p.RoleARN),
RoleSessionName: aws.String(p.RoleSessionName),
ExternalId: p.ExternalID,
})
if err != nil {
return credentials.Value{}, err
}
// We will proactively generate new credentials before they expire.
p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow)
return credentials.Value{
AccessKeyID: *roleOutput.Credentials.AccessKeyId,
SecretAccessKey: *roleOutput.Credentials.SecretAccessKey,
SessionToken: *roleOutput.Credentials.SessionToken,
}, nil
}
示例13: ExampleKinesis_PutRecords
func ExampleKinesis_PutRecords() {
svc := kinesis.New(nil)
params := &kinesis.PutRecordsInput{
Records: []*kinesis.PutRecordsRequestEntry{ // Required
{ // Required
Data: []byte("PAYLOAD"), // Required
PartitionKey: aws.String("PartitionKey"), // Required
ExplicitHashKey: aws.String("HashKey"),
},
// More values...
},
StreamName: aws.String("StreamName"), // Required
}
resp, err := svc.PutRecords(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)
}
示例14: ExampleSQS_ChangeMessageVisibilityBatch
func ExampleSQS_ChangeMessageVisibilityBatch() {
svc := sqs.New(nil)
params := &sqs.ChangeMessageVisibilityBatchInput{
Entries: []*sqs.ChangeMessageVisibilityBatchRequestEntry{ // Required
{ // Required
Id: aws.String("String"), // Required
ReceiptHandle: aws.String("String"), // Required
VisibilityTimeout: aws.Int64(1),
},
// More values...
},
QueueUrl: aws.String("String"), // Required
}
resp, err := svc.ChangeMessageVisibilityBatch(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)
}
示例15: ExampleCloudTrail_LookupEvents
func ExampleCloudTrail_LookupEvents() {
svc := cloudtrail.New(nil)
params := &cloudtrail.LookupEventsInput{
EndTime: aws.Time(time.Now()),
LookupAttributes: []*cloudtrail.LookupAttribute{
{ // Required
AttributeKey: aws.String("LookupAttributeKey"), // Required
AttributeValue: aws.String("String"), // Required
},
// More values...
},
MaxResults: aws.Int64(1),
NextToken: aws.String("NextToken"),
StartTime: aws.Time(time.Now()),
}
resp, err := svc.LookupEvents(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)
}