本文整理匯總了Golang中github.com/dragonfax/aws-sdk-go/aws.Time函數的典型用法代碼示例。如果您正苦於以下問題:Golang Time函數的具體用法?Golang Time怎麽用?Golang Time使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Time函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ExampleAutoScaling_DescribeScheduledActions
func ExampleAutoScaling_DescribeScheduledActions() {
svc := autoscaling.New(nil)
params := &autoscaling.DescribeScheduledActionsInput{
AutoScalingGroupName: aws.String("ResourceName"),
EndTime: aws.Time(time.Now()),
MaxRecords: aws.Int64(1),
NextToken: aws.String("XmlString"),
ScheduledActionNames: []*string{
aws.String("ResourceName"), // Required
// More values...
},
StartTime: aws.Time(time.Now()),
}
resp, err := svc.DescribeScheduledActions(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: ExampleElasticBeanstalk_DescribeEvents
func ExampleElasticBeanstalk_DescribeEvents() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.DescribeEventsInput{
ApplicationName: aws.String("ApplicationName"),
EndTime: aws.Time(time.Now()),
EnvironmentId: aws.String("EnvironmentId"),
EnvironmentName: aws.String("EnvironmentName"),
MaxRecords: aws.Int64(1),
NextToken: aws.String("Token"),
RequestId: aws.String("RequestId"),
Severity: aws.String("EventSeverity"),
StartTime: aws.Time(time.Now()),
TemplateName: aws.String("ConfigurationTemplateName"),
VersionLabel: aws.String("VersionLabel"),
}
resp, err := svc.DescribeEvents(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: ExampleAutoScaling_PutScheduledUpdateGroupAction
func ExampleAutoScaling_PutScheduledUpdateGroupAction() {
svc := autoscaling.New(nil)
params := &autoscaling.PutScheduledUpdateGroupActionInput{
AutoScalingGroupName: aws.String("ResourceName"), // Required
ScheduledActionName: aws.String("XmlStringMaxLen255"), // Required
DesiredCapacity: aws.Int64(1),
EndTime: aws.Time(time.Now()),
MaxSize: aws.Int64(1),
MinSize: aws.Int64(1),
Recurrence: aws.String("XmlStringMaxLen255"),
StartTime: aws.Time(time.Now()),
Time: aws.Time(time.Now()),
}
resp, err := svc.PutScheduledUpdateGroupAction(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: 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)
}
示例5: ExampleCodeDeploy_ListDeployments
func ExampleCodeDeploy_ListDeployments() {
svc := codedeploy.New(nil)
params := &codedeploy.ListDeploymentsInput{
ApplicationName: aws.String("ApplicationName"),
CreateTimeRange: &codedeploy.TimeRange{
End: aws.Time(time.Now()),
Start: aws.Time(time.Now()),
},
DeploymentGroupName: aws.String("DeploymentGroupName"),
IncludeOnlyStatuses: []*string{
aws.String("DeploymentStatus"), // Required
// More values...
},
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListDeployments(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: ExampleSWF_CountOpenWorkflowExecutions
func ExampleSWF_CountOpenWorkflowExecutions() {
svc := swf.New(nil)
params := &swf.CountOpenWorkflowExecutionsInput{
Domain: aws.String("DomainName"), // Required
StartTimeFilter: &swf.ExecutionTimeFilter{ // Required
OldestDate: aws.Time(time.Now()), // Required
LatestDate: aws.Time(time.Now()),
},
ExecutionFilter: &swf.WorkflowExecutionFilter{
WorkflowId: aws.String("WorkflowId"), // Required
},
TagFilter: &swf.TagFilter{
Tag: aws.String("Tag"), // Required
},
TypeFilter: &swf.WorkflowTypeFilter{
Name: aws.String("Name"), // Required
Version: aws.String("VersionOptional"),
},
}
resp, err := svc.CountOpenWorkflowExecutions(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: ExampleS3_HeadObject
func ExampleS3_HeadObject() {
svc := s3.New(nil)
params := &s3.HeadObjectInput{
Bucket: aws.String("BucketName"), // Required
Key: aws.String("ObjectKey"), // Required
IfMatch: aws.String("IfMatch"),
IfModifiedSince: aws.Time(time.Now()),
IfNoneMatch: aws.String("IfNoneMatch"),
IfUnmodifiedSince: aws.Time(time.Now()),
Range: aws.String("Range"),
RequestPayer: aws.String("RequestPayer"),
SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"),
SSECustomerKey: aws.String("SSECustomerKey"),
SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"),
VersionId: aws.String("ObjectVersionId"),
}
resp, err := svc.HeadObject(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: ExampleS3_UploadPartCopy
func ExampleS3_UploadPartCopy() {
svc := s3.New(nil)
params := &s3.UploadPartCopyInput{
Bucket: aws.String("BucketName"), // Required
CopySource: aws.String("CopySource"), // Required
Key: aws.String("ObjectKey"), // Required
PartNumber: aws.Int64(1), // Required
UploadId: aws.String("MultipartUploadId"), // Required
CopySourceIfMatch: aws.String("CopySourceIfMatch"),
CopySourceIfModifiedSince: aws.Time(time.Now()),
CopySourceIfNoneMatch: aws.String("CopySourceIfNoneMatch"),
CopySourceIfUnmodifiedSince: aws.Time(time.Now()),
CopySourceRange: aws.String("CopySourceRange"),
CopySourceSSECustomerAlgorithm: aws.String("CopySourceSSECustomerAlgorithm"),
CopySourceSSECustomerKey: aws.String("CopySourceSSECustomerKey"),
CopySourceSSECustomerKeyMD5: aws.String("CopySourceSSECustomerKeyMD5"),
RequestPayer: aws.String("RequestPayer"),
SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"),
SSECustomerKey: aws.String("SSECustomerKey"),
SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"),
}
resp, err := svc.UploadPartCopy(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: ExampleCloudWatch_GetMetricStatistics
func ExampleCloudWatch_GetMetricStatistics() {
svc := cloudwatch.New(nil)
params := &cloudwatch.GetMetricStatisticsInput{
EndTime: aws.Time(time.Now()), // Required
MetricName: aws.String("MetricName"), // Required
Namespace: aws.String("Namespace"), // Required
Period: aws.Int64(1), // Required
StartTime: aws.Time(time.Now()), // Required
Statistics: []*string{ // Required
aws.String("Statistic"), // Required
// More values...
},
Dimensions: []*cloudwatch.Dimension{
{ // Required
Name: aws.String("DimensionName"), // Required
Value: aws.String("DimensionValue"), // Required
},
// More values...
},
Unit: aws.String("StandardUnit"),
}
resp, err := svc.GetMetricStatistics(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: ExampleRedshift_DescribeClusterSnapshots
func ExampleRedshift_DescribeClusterSnapshots() {
svc := redshift.New(nil)
params := &redshift.DescribeClusterSnapshotsInput{
ClusterIdentifier: aws.String("String"),
EndTime: aws.Time(time.Now()),
Marker: aws.String("String"),
MaxRecords: aws.Int64(1),
OwnerAccount: aws.String("String"),
SnapshotIdentifier: aws.String("String"),
SnapshotType: aws.String("String"),
StartTime: aws.Time(time.Now()),
TagKeys: []*string{
aws.String("String"), // Required
// More values...
},
TagValues: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.DescribeClusterSnapshots(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: 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 {
// 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: ExampleS3_CopyObject
func ExampleS3_CopyObject() {
svc := s3.New(nil)
params := &s3.CopyObjectInput{
Bucket: aws.String("BucketName"), // Required
CopySource: aws.String("CopySource"), // Required
Key: aws.String("ObjectKey"), // Required
ACL: aws.String("ObjectCannedACL"),
CacheControl: aws.String("CacheControl"),
ContentDisposition: aws.String("ContentDisposition"),
ContentEncoding: aws.String("ContentEncoding"),
ContentLanguage: aws.String("ContentLanguage"),
ContentType: aws.String("ContentType"),
CopySourceIfMatch: aws.String("CopySourceIfMatch"),
CopySourceIfModifiedSince: aws.Time(time.Now()),
CopySourceIfNoneMatch: aws.String("CopySourceIfNoneMatch"),
CopySourceIfUnmodifiedSince: aws.Time(time.Now()),
CopySourceSSECustomerAlgorithm: aws.String("CopySourceSSECustomerAlgorithm"),
CopySourceSSECustomerKey: aws.String("CopySourceSSECustomerKey"),
CopySourceSSECustomerKeyMD5: aws.String("CopySourceSSECustomerKeyMD5"),
Expires: aws.Time(time.Now()),
GrantFullControl: aws.String("GrantFullControl"),
GrantRead: aws.String("GrantRead"),
GrantReadACP: aws.String("GrantReadACP"),
GrantWriteACP: aws.String("GrantWriteACP"),
Metadata: map[string]*string{
"Key": aws.String("MetadataValue"), // Required
// More values...
},
MetadataDirective: aws.String("MetadataDirective"),
RequestPayer: aws.String("RequestPayer"),
SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"),
SSECustomerKey: aws.String("SSECustomerKey"),
SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"),
SSEKMSKeyId: aws.String("SSEKMSKeyId"),
ServerSideEncryption: aws.String("ServerSideEncryption"),
StorageClass: aws.String("StorageClass"),
WebsiteRedirectLocation: aws.String("WebsiteRedirectLocation"),
}
resp, err := svc.CopyObject(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)
}
示例13: ExampleCognitoSync_UpdateRecords
func ExampleCognitoSync_UpdateRecords() {
svc := cognitosync.New(nil)
params := &cognitosync.UpdateRecordsInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
SyncSessionToken: aws.String("SyncSessionToken"), // Required
ClientContext: aws.String("ClientContext"),
DeviceId: aws.String("DeviceId"),
RecordPatches: []*cognitosync.RecordPatch{
{ // Required
Key: aws.String("RecordKey"), // Required
Op: aws.String("Operation"), // Required
SyncCount: aws.Int64(1), // Required
DeviceLastModifiedDate: aws.Time(time.Now()),
Value: aws.String("RecordValue"),
},
// More values...
},
}
resp, err := svc.UpdateRecords(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: 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 {
// 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: ExampleSSM_UpdateAssociationStatus
func ExampleSSM_UpdateAssociationStatus() {
svc := ssm.New(nil)
params := &ssm.UpdateAssociationStatusInput{
AssociationStatus: &ssm.AssociationStatus{ // Required
Date: aws.Time(time.Now()), // Required
Message: aws.String("StatusMessage"), // Required
Name: aws.String("AssociationStatusName"), // Required
AdditionalInfo: aws.String("StatusAdditionalInfo"),
},
InstanceId: aws.String("InstanceId"), // Required
Name: aws.String("DocumentName"), // Required
}
resp, err := svc.UpdateAssociationStatus(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)
}