本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/swf.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleSWF_DescribeWorkflowType
func ExampleSWF_DescribeWorkflowType() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.DescribeWorkflowTypeInput{
Domain: aws.String("DomainName"), // Required
WorkflowType: &swf.WorkflowType{ // Required
Name: aws.String("Name"), // Required
Version: aws.String("Version"), // Required
},
}
resp, err := svc.DescribeWorkflowType(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
示例2: ExampleSWF_GetWorkflowExecutionHistory
func ExampleSWF_GetWorkflowExecutionHistory() {
svc := swf.New(session.New())
params := &swf.GetWorkflowExecutionHistoryInput{
Domain: aws.String("DomainName"), // Required
Execution: &swf.WorkflowExecution{ // Required
RunId: aws.String("RunId"), // Required
WorkflowId: aws.String("WorkflowId"), // Required
},
MaximumPageSize: aws.Int64(1),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Bool(true),
}
resp, err := svc.GetWorkflowExecutionHistory(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,代码行数:25,代码来源:examples_test.go
示例3: ExampleSWF_PollForDecisionTask
func ExampleSWF_PollForDecisionTask() {
svc := swf.New(session.New())
params := &swf.PollForDecisionTaskInput{
Domain: aws.String("DomainName"), // Required
TaskList: &swf.TaskList{ // Required
Name: aws.String("Name"), // Required
},
Identity: aws.String("Identity"),
MaximumPageSize: aws.Int64(1),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Bool(true),
}
resp, err := svc.PollForDecisionTask(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,代码行数:25,代码来源:examples_test.go
示例4: ExampleSWF_PollForDecisionTask
func ExampleSWF_PollForDecisionTask() {
svc := swf.New(nil)
params := &swf.PollForDecisionTaskInput{
Domain: aws.String("DomainName"), // Required
TaskList: &swf.TaskList{ // Required
Name: aws.String("Name"), // Required
},
Identity: aws.String("Identity"),
MaximumPageSize: aws.Long(1),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Boolean(true),
}
resp, err := svc.PollForDecisionTask(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.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:33,代码来源:examples_test.go
示例5: ExampleSWF_GetWorkflowExecutionHistory
func ExampleSWF_GetWorkflowExecutionHistory() {
svc := swf.New(nil)
params := &swf.GetWorkflowExecutionHistoryInput{
Domain: aws.String("DomainName"), // Required
Execution: &swf.WorkflowExecution{ // Required
RunID: aws.String("RunId"), // Required
WorkflowID: aws.String("WorkflowId"), // Required
},
MaximumPageSize: aws.Long(1),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Boolean(true),
}
resp, err := svc.GetWorkflowExecutionHistory(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.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:33,代码来源:examples_test.go
示例6: ExampleSWF_CountPendingDecisionTasks
func ExampleSWF_CountPendingDecisionTasks() {
svc := swf.New(nil)
params := &swf.CountPendingDecisionTasksInput{
Domain: aws.String("DomainName"), // Required
TaskList: &swf.TaskList{ // Required
Name: aws.String("Name"), // Required
},
}
resp, err := svc.CountPendingDecisionTasks(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:Talos208,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go
示例7: ExampleSWF_RegisterDomain
func ExampleSWF_RegisterDomain() {
svc := swf.New(nil)
params := &swf.RegisterDomainInput{
Name: aws.String("DomainName"), // Required
WorkflowExecutionRetentionPeriodInDays: aws.String("DurationInDays"), // Required
Description: aws.String("Description"),
}
resp, err := svc.RegisterDomain(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:Talos208,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例8: ExampleSWF_ListOpenWorkflowExecutions
func ExampleSWF_ListOpenWorkflowExecutions() {
svc := swf.New(nil)
params := &swf.ListOpenWorkflowExecutionsInput{
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
},
MaximumPageSize: aws.Int64(1),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Bool(true),
TagFilter: &swf.TagFilter{
Tag: aws.String("Tag"), // Required
},
TypeFilter: &swf.WorkflowTypeFilter{
Name: aws.String("Name"), // Required
Version: aws.String("VersionOptional"),
},
}
resp, err := svc.ListOpenWorkflowExecutions(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:Celluliodio,项目名称:flannel,代码行数:35,代码来源:examples_test.go
示例9: ExampleSWF_RegisterActivityType
func ExampleSWF_RegisterActivityType() {
svc := swf.New(nil)
params := &swf.RegisterActivityTypeInput{
Domain: aws.String("DomainName"), // Required
Name: aws.String("Name"), // Required
Version: aws.String("Version"), // Required
DefaultTaskHeartbeatTimeout: aws.String("DurationInSecondsOptional"),
DefaultTaskList: &swf.TaskList{
Name: aws.String("Name"), // Required
},
DefaultTaskPriority: aws.String("TaskPriority"),
DefaultTaskScheduleToCloseTimeout: aws.String("DurationInSecondsOptional"),
DefaultTaskScheduleToStartTimeout: aws.String("DurationInSecondsOptional"),
DefaultTaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
Description: aws.String("Description"),
}
resp, err := svc.RegisterActivityType(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:Celluliodio,项目名称:flannel,代码行数:29,代码来源:examples_test.go
示例10: ExampleSWF_RespondActivityTaskFailed
func ExampleSWF_RespondActivityTaskFailed() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.RespondActivityTaskFailedInput{
TaskToken: aws.String("TaskToken"), // Required
Details: aws.String("Data"),
Reason: aws.String("FailureReason"),
}
resp, err := svc.RespondActivityTaskFailed(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,代码行数:26,代码来源:examples_test.go
示例11: ExampleSWF_SignalWorkflowExecution
func ExampleSWF_SignalWorkflowExecution() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.SignalWorkflowExecutionInput{
Domain: aws.String("DomainName"), // Required
SignalName: aws.String("SignalName"), // Required
WorkflowId: aws.String("WorkflowId"), // Required
Input: aws.String("Data"),
RunId: aws.String("RunIdOptional"),
}
resp, err := svc.SignalWorkflowExecution(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
示例12: ExampleSWF_RegisterDomain
func ExampleSWF_RegisterDomain() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.RegisterDomainInput{
Name: aws.String("DomainName"), // Required
WorkflowExecutionRetentionPeriodInDays: aws.String("DurationInDays"), // Required
Description: aws.String("Description"),
}
resp, err := svc.RegisterDomain(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,代码行数:26,代码来源:examples_test.go
示例13: ExampleSWF_PollForActivityTask
func ExampleSWF_PollForActivityTask() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.PollForActivityTaskInput{
Domain: aws.String("DomainName"), // Required
TaskList: &swf.TaskList{ // Required
Name: aws.String("Name"), // Required
},
Identity: aws.String("Identity"),
}
resp, err := svc.PollForActivityTask(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: ExampleSWF_ListWorkflowTypes
func ExampleSWF_ListWorkflowTypes() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := swf.New(sess)
params := &swf.ListWorkflowTypesInput{
Domain: aws.String("DomainName"), // Required
RegistrationStatus: aws.String("RegistrationStatus"), // Required
MaximumPageSize: aws.Int64(1),
Name: aws.String("Name"),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Bool(true),
}
resp, err := svc.ListWorkflowTypes(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
示例15: ExampleSWF_RegisterWorkflowType
func ExampleSWF_RegisterWorkflowType() {
svc := swf.New(session.New())
params := &swf.RegisterWorkflowTypeInput{
Domain: aws.String("DomainName"), // Required
Name: aws.String("Name"), // Required
Version: aws.String("Version"), // Required
DefaultChildPolicy: aws.String("ChildPolicy"),
DefaultExecutionStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
DefaultLambdaRole: aws.String("Arn"),
DefaultTaskList: &swf.TaskList{
Name: aws.String("Name"), // Required
},
DefaultTaskPriority: aws.String("TaskPriority"),
DefaultTaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
Description: aws.String("Description"),
}
resp, err := svc.RegisterWorkflowType(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
示例16: ExampleSWF_RespondActivityTaskFailed
func ExampleSWF_RespondActivityTaskFailed() {
svc := swf.New(nil)
params := &swf.RespondActivityTaskFailedInput{
TaskToken: aws.String("TaskToken"), // Required
Details: aws.String("Data"),
Reason: aws.String("FailureReason"),
}
resp, err := svc.RespondActivityTaskFailed(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.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例17: ExampleSWF_DescribeActivityType
func ExampleSWF_DescribeActivityType() {
svc := swf.New(nil)
params := &swf.DescribeActivityTypeInput{
ActivityType: &swf.ActivityType{ // Required
Name: aws.String("Name"), // Required
Version: aws.String("Version"), // Required
},
Domain: aws.String("DomainName"), // Required
}
resp, err := svc.DescribeActivityType(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.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例18: ExampleSWF_RequestCancelWorkflowExecution
func ExampleSWF_RequestCancelWorkflowExecution() {
svc := swf.New(nil)
params := &swf.RequestCancelWorkflowExecutionInput{
Domain: aws.String("DomainName"), // Required
WorkflowID: aws.String("WorkflowId"), // Required
RunID: aws.String("RunIdOptional"),
}
resp, err := svc.RequestCancelWorkflowExecution(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.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例19: ExampleSWF_ListWorkflowTypes
func ExampleSWF_ListWorkflowTypes() {
svc := swf.New(nil)
params := &swf.ListWorkflowTypesInput{
Domain: aws.String("DomainName"), // Required
RegistrationStatus: aws.String("RegistrationStatus"), // Required
MaximumPageSize: aws.Int64(1),
Name: aws.String("Name"),
NextPageToken: aws.String("PageToken"),
ReverseOrder: aws.Bool(true),
}
resp, err := svc.ListWorkflowTypes(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:Talos208,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go
示例20: ExampleSWF_CountOpenWorkflowExecutions
func ExampleSWF_CountOpenWorkflowExecutions() {
svc := swf.New(session.New())
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)
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go
注:本文中的github.com/aws/aws-sdk-go/service/swf.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论