本文整理汇总了Golang中github.com/aws/aws-sdk-go/aws.Int64函数的典型用法代码示例。如果您正苦于以下问题:Golang Int64函数的具体用法?Golang Int64怎么用?Golang Int64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Int64函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleStorageGateway_UpdateMaintenanceStartTime
func ExampleStorageGateway_UpdateMaintenanceStartTime() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := storagegateway.New(sess)
params := &storagegateway.UpdateMaintenanceStartTimeInput{
DayOfWeek: aws.Int64(1), // Required
GatewayARN: aws.String("GatewayARN"), // Required
HourOfDay: aws.Int64(1), // Required
MinuteOfHour: aws.Int64(1), // Required
}
resp, err := svc.UpdateMaintenanceStartTime(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:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go
示例2: ExampleLambda_CreateFunction
func ExampleLambda_CreateFunction() {
svc := lambda.New(nil)
params := &lambda.CreateFunctionInput{
Code: &lambda.FunctionCode{ // Required
S3Bucket: aws.String("S3Bucket"),
S3Key: aws.String("S3Key"),
S3ObjectVersion: aws.String("S3ObjectVersion"),
ZipFile: []byte("PAYLOAD"),
},
FunctionName: aws.String("FunctionName"), // Required
Handler: aws.String("Handler"), // Required
Role: aws.String("RoleArn"), // Required
Runtime: aws.String("Runtime"), // Required
Description: aws.String("Description"),
MemorySize: aws.Int64(1),
Timeout: aws.Int64(1),
}
resp, err := svc.CreateFunction(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:jloper3,项目名称:amazon-ecs-cli,代码行数:30,代码来源:examples_test.go
示例3: ExampleECR_UploadLayerPart
func ExampleECR_UploadLayerPart() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := ecr.New(sess)
params := &ecr.UploadLayerPartInput{
LayerPartBlob: []byte("PAYLOAD"), // Required
PartFirstByte: aws.Int64(1), // Required
PartLastByte: aws.Int64(1), // Required
RepositoryName: aws.String("RepositoryName"), // Required
UploadId: aws.String("UploadId"), // Required
RegistryId: aws.String("RegistryId"),
}
resp, err := svc.UploadLayerPart(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:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go
示例4: ExampleECS_SubmitContainerStateChange
func ExampleECS_SubmitContainerStateChange() {
svc := ecs.New(session.New())
params := &ecs.SubmitContainerStateChangeInput{
Cluster: aws.String("String"),
ContainerName: aws.String("String"),
ExitCode: aws.Int64(1),
NetworkBindings: []*ecs.NetworkBinding{
{ // Required
BindIP: aws.String("String"),
ContainerPort: aws.Int64(1),
HostPort: aws.Int64(1),
Protocol: aws.String("TransportProtocol"),
},
// More values...
},
Reason: aws.String("String"),
Status: aws.String("String"),
Task: aws.String("String"),
}
resp, err := svc.SubmitContainerStateChange(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:CNDonny,项目名称:scope,代码行数:32,代码来源:examples_test.go
示例5: ExampleELB_ConfigureHealthCheck
func ExampleELB_ConfigureHealthCheck() {
svc := elb.New(nil)
params := &elb.ConfigureHealthCheckInput{
HealthCheck: &elb.HealthCheck{ // Required
HealthyThreshold: aws.Int64(1), // Required
Interval: aws.Int64(1), // Required
Target: aws.String("HealthCheckTarget"), // Required
Timeout: aws.Int64(1), // Required
UnhealthyThreshold: aws.Int64(1), // Required
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.ConfigureHealthCheck(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:jloper3,项目名称:amazon-ecs-cli,代码行数:25,代码来源:examples_test.go
示例6: testAccCheckAWSSecurityGroupAttributes
func testAccCheckAWSSecurityGroupAttributes(group *ec2.SecurityGroup) resource.TestCheckFunc {
return func(s *terraform.State) error {
p := &ec2.IpPermission{
FromPort: aws.Int64(80),
ToPort: aws.Int64(8000),
IpProtocol: aws.String("tcp"),
IpRanges: []*ec2.IpRange{&ec2.IpRange{CidrIp: aws.String("10.0.0.0/8")}},
}
if *group.GroupName != "terraform_acceptance_test_example" {
return fmt.Errorf("Bad name: %s", *group.GroupName)
}
if *group.Description != "Used in the terraform acceptance tests" {
return fmt.Errorf("Bad description: %s", *group.Description)
}
if len(group.IpPermissions) == 0 {
return fmt.Errorf("No IPPerms")
}
// Compare our ingress
if !reflect.DeepEqual(group.IpPermissions[0], p) {
return fmt.Errorf(
"Got:\n\n%#v\n\nExpected:\n\n%#v\n",
group.IpPermissions[0],
p)
}
return nil
}
}
开发者ID:paultyng,项目名称:terraform,代码行数:32,代码来源:resource_aws_security_group_test.go
示例7: resourceAwsEcsServiceUpdate
func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ecsconn
log.Printf("[DEBUG] Updating ECS service %s", d.Id())
input := ecs.UpdateServiceInput{
Service: aws.String(d.Id()),
Cluster: aws.String(d.Get("cluster").(string)),
}
if d.HasChange("desired_count") {
_, n := d.GetChange("desired_count")
input.DesiredCount = aws.Int64(int64(n.(int)))
}
if d.HasChange("task_definition") {
_, n := d.GetChange("task_definition")
input.TaskDefinition = aws.String(n.(string))
}
if d.HasChange("deployment_maximum_percent") || d.HasChange("deployment_minimum_healthy_percent") {
input.DeploymentConfiguration = &ecs.DeploymentConfiguration{
MaximumPercent: aws.Int64(int64(d.Get("deployment_maximum_percent").(int))),
MinimumHealthyPercent: aws.Int64(int64(d.Get("deployment_minimum_healthy_percent").(int))),
}
}
out, err := conn.UpdateService(&input)
if err != nil {
return err
}
service := out.Service
log.Printf("[DEBUG] Updated ECS service %s", service)
return resourceAwsEcsServiceRead(d, meta)
}
开发者ID:paultyng,项目名称:terraform,代码行数:34,代码来源:resource_aws_ecs_service.go
示例8: ExampleSQS_ReceiveMessage
func ExampleSQS_ReceiveMessage() {
svc := sqs.New(session.New())
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)
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go
示例9: ExampleRoute53_UpdateHealthCheck
func ExampleRoute53_UpdateHealthCheck() {
svc := route53.New(session.New())
params := &route53.UpdateHealthCheckInput{
HealthCheckId: aws.String("HealthCheckId"), // Required
ChildHealthChecks: []*string{
aws.String("HealthCheckId"), // Required
// More values...
},
FailureThreshold: aws.Int64(1),
FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"),
HealthCheckVersion: aws.Int64(1),
HealthThreshold: aws.Int64(1),
IPAddress: aws.String("IPAddress"),
Inverted: aws.Bool(true),
Port: aws.Int64(1),
ResourcePath: aws.String("ResourcePath"),
SearchString: aws.String("SearchString"),
}
resp, err := svc.UpdateHealthCheck(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:frewsxcv,项目名称:empire,代码行数:31,代码来源:examples_test.go
示例10: testAccCheckAWSELBAttributes
func testAccCheckAWSELBAttributes(conf *elb.LoadBalancerDescription) resource.TestCheckFunc {
return func(s *terraform.State) error {
zones := []string{"us-west-2a", "us-west-2b", "us-west-2c"}
azs := make([]string, 0, len(conf.AvailabilityZones))
for _, x := range conf.AvailabilityZones {
azs = append(azs, *x)
}
sort.StringSlice(azs).Sort()
if !reflect.DeepEqual(azs, zones) {
return fmt.Errorf("bad availability_zones")
}
l := elb.Listener{
InstancePort: aws.Int64(int64(8000)),
InstanceProtocol: aws.String("HTTP"),
LoadBalancerPort: aws.Int64(int64(80)),
Protocol: aws.String("HTTP"),
}
if !reflect.DeepEqual(conf.ListenerDescriptions[0].Listener, &l) {
return fmt.Errorf(
"Got:\n\n%#v\n\nExpected:\n\n%#v\n",
conf.ListenerDescriptions[0].Listener,
l)
}
if *conf.DNSName == "" {
return fmt.Errorf("empty dns_name")
}
return nil
}
}
开发者ID:partamonov,项目名称:terraform,代码行数:33,代码来源:resource_aws_elb_test.go
示例11: testAccCheckAWSELBAttributesHealthCheck
func testAccCheckAWSELBAttributesHealthCheck(conf *elb.LoadBalancerDescription) resource.TestCheckFunc {
return func(s *terraform.State) error {
zones := []string{"us-west-2a", "us-west-2b", "us-west-2c"}
azs := make([]string, 0, len(conf.AvailabilityZones))
for _, x := range conf.AvailabilityZones {
azs = append(azs, *x)
}
sort.StringSlice(azs).Sort()
if !reflect.DeepEqual(azs, zones) {
return fmt.Errorf("bad availability_zones")
}
check := &elb.HealthCheck{
Timeout: aws.Int64(int64(30)),
UnhealthyThreshold: aws.Int64(int64(5)),
HealthyThreshold: aws.Int64(int64(5)),
Interval: aws.Int64(int64(60)),
Target: aws.String("HTTP:8000/"),
}
if !reflect.DeepEqual(conf.HealthCheck, check) {
return fmt.Errorf(
"Got:\n\n%#v\n\nExpected:\n\n%#v\n",
conf.HealthCheck,
check)
}
if *conf.DNSName == "" {
return fmt.Errorf("empty dns_name")
}
return nil
}
}
开发者ID:partamonov,项目名称:terraform,代码行数:34,代码来源:resource_aws_elb_test.go
示例12: receive_from_queue
func receive_from_queue(svc *sqs.SQS, queue_url *string) (*string, *string, *string, error) {
// get sqs message
params := &sqs.ReceiveMessageInput{
QueueUrl: queue_url,
MaxNumberOfMessages: aws.Int64(1),
VisibilityTimeout: aws.Int64(1),
}
resp, err := svc.ReceiveMessage(params)
if err != nil { return nil, nil, nil, err }
// error on empty queue
if len(resp.Messages) == 0 { return nil, nil, nil, errors.New("queue is empty") }
receipt_handle := resp.Messages[0].ReceiptHandle
body := resp.Messages[0].Body
// unmarshal sqs message body
data := &SqsBody{}
err = json.Unmarshal([]byte(*body), &data)
if err != nil { return nil, nil, nil, err }
bucket := &data.Records[0].S3.Bucket.Name
key := &data.Records[0].S3.Object.Key
return receipt_handle, bucket, key, nil
}
开发者ID:relud,项目名称:heka_plugin_sqs3,代码行数:25,代码来源:sqs3_input.go
示例13: ExampleStorageGateway_CreateTapes
func ExampleStorageGateway_CreateTapes() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := storagegateway.New(sess)
params := &storagegateway.CreateTapesInput{
ClientToken: aws.String("ClientToken"), // Required
GatewayARN: aws.String("GatewayARN"), // Required
NumTapesToCreate: aws.Int64(1), // Required
TapeBarcodePrefix: aws.String("TapeBarcodePrefix"), // Required
TapeSizeInBytes: aws.Int64(1), // Required
}
resp, err := svc.CreateTapes(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:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go
示例14: ExampleStorageGateway_UpdateSnapshotSchedule
func ExampleStorageGateway_UpdateSnapshotSchedule() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := storagegateway.New(sess)
params := &storagegateway.UpdateSnapshotScheduleInput{
RecurrenceInHours: aws.Int64(1), // Required
StartAt: aws.Int64(1), // Required
VolumeARN: aws.String("VolumeARN"), // Required
Description: aws.String("Description"),
}
resp, err := svc.UpdateSnapshotSchedule(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:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go
示例15: TestFlattenHealthCheck
func TestFlattenHealthCheck(t *testing.T) {
cases := []struct {
Input *elb.HealthCheck
Output []map[string]interface{}
}{
{
Input: &elb.HealthCheck{
UnhealthyThreshold: aws.Int64(int64(10)),
HealthyThreshold: aws.Int64(int64(10)),
Target: aws.String("HTTP:80/"),
Timeout: aws.Int64(int64(30)),
Interval: aws.Int64(int64(30)),
},
Output: []map[string]interface{}{
map[string]interface{}{
"unhealthy_threshold": int64(10),
"healthy_threshold": int64(10),
"target": "HTTP:80/",
"timeout": int64(30),
"interval": int64(30),
},
},
},
}
for _, tc := range cases {
output := flattenHealthCheck(tc.Input)
if !reflect.DeepEqual(output, tc.Output) {
t.Fatalf("Got:\n\n%#v\n\nExpected:\n\n%#v", output, tc.Output)
}
}
}
开发者ID:partamonov,项目名称:terraform,代码行数:32,代码来源:structure_test.go
示例16: expandCacheBehavior
func expandCacheBehavior(m map[string]interface{}) *cloudfront.CacheBehavior {
cb := &cloudfront.CacheBehavior{
Compress: aws.Bool(m["compress"].(bool)),
ViewerProtocolPolicy: aws.String(m["viewer_protocol_policy"].(string)),
TargetOriginId: aws.String(m["target_origin_id"].(string)),
ForwardedValues: expandForwardedValues(m["forwarded_values"].(*schema.Set).List()[0].(map[string]interface{})),
MinTTL: aws.Int64(int64(m["min_ttl"].(int))),
MaxTTL: aws.Int64(int64(m["max_ttl"].(int))),
DefaultTTL: aws.Int64(int64(m["default_ttl"].(int))),
}
if v, ok := m["trusted_signers"]; ok {
cb.TrustedSigners = expandTrustedSigners(v.([]interface{}))
} else {
cb.TrustedSigners = expandTrustedSigners([]interface{}{})
}
if v, ok := m["smooth_streaming"]; ok {
cb.SmoothStreaming = aws.Bool(v.(bool))
}
if v, ok := m["allowed_methods"]; ok {
cb.AllowedMethods = expandAllowedMethods(v.([]interface{}))
}
if v, ok := m["cached_methods"]; ok {
cb.AllowedMethods.CachedMethods = expandCachedMethods(v.([]interface{}))
}
if v, ok := m["path_pattern"]; ok {
cb.PathPattern = aws.String(v.(string))
}
return cb
}
开发者ID:chandy,项目名称:terraform,代码行数:29,代码来源:cloudfront_distribution_configuration_structure.go
示例17: ExampleCloudSearchDomain_Search
func ExampleCloudSearchDomain_Search() {
svc := cloudsearchdomain.New(session.New())
params := &cloudsearchdomain.SearchInput{
Query: aws.String("Query"), // Required
Cursor: aws.String("Cursor"),
Expr: aws.String("Expr"),
Facet: aws.String("Facet"),
FilterQuery: aws.String("FilterQuery"),
Highlight: aws.String("Highlight"),
Partial: aws.Bool(true),
QueryOptions: aws.String("QueryOptions"),
QueryParser: aws.String("QueryParser"),
Return: aws.String("Return"),
Size: aws.Int64(1),
Sort: aws.String("Sort"),
Start: aws.Int64(1),
}
resp, err := svc.Search(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:charles-at-linknext,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例18: ExampleStorageGateway_UpdateBandwidthRateLimit
func ExampleStorageGateway_UpdateBandwidthRateLimit() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateBandwidthRateLimitInput{
GatewayARN: aws.String("GatewayARN"), // Required
AverageDownloadRateLimitInBitsPerSec: aws.Int64(1),
AverageUploadRateLimitInBitsPerSec: aws.Int64(1),
}
resp, err := svc.UpdateBandwidthRateLimit(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:strife25,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例19: dequeueMessage
func dequeueMessage() ([]Message, error) {
req := &sqs.ReceiveMessageInput{
MaxNumberOfMessages: aws.Int64(10),
QueueUrl: aws.String(MessageQueueUrl),
WaitTimeSeconds: aws.Int64(10),
}
res, err := SQS().ReceiveMessage(req)
if err != nil {
return nil, err
}
messages := make([]Message, len(res.Messages))
var message Message
for i, m := range res.Messages {
err = json.Unmarshal([]byte(*m.Body), &message)
if err != nil {
return nil, err
}
message.MessageID = m.MessageId
message.ReceiptHandle = m.ReceiptHandle
messages[i] = message
}
return messages, nil
}
开发者ID:cleblanc87,项目名称:rack,代码行数:32,代码来源:formation.go
示例20: ExampleStorageGateway_UpdateMaintenanceStartTime
func ExampleStorageGateway_UpdateMaintenanceStartTime() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateMaintenanceStartTimeInput{
DayOfWeek: aws.Int64(1), // Required
GatewayARN: aws.String("GatewayARN"), // Required
HourOfDay: aws.Int64(1), // Required
MinuteOfHour: aws.Int64(1), // Required
}
resp, err := svc.UpdateMaintenanceStartTime(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:strife25,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go
注:本文中的github.com/aws/aws-sdk-go/aws.Int64函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论