diff --git a/Dockerfile b/Dockerfile index 3f6bce01..63f8fd29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM golang:1.17 as build RUN mkdir /package -COPY /internal /package/internal COPY /sdk /package/sdk COPY /go.mod /package/go.mod COPY /go.sum /package/go.sum diff --git a/LICENSE b/LICENSE index 261eeb9e..8d28cb17 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Orkes, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index fdf48aaf..7cacfb9e 100644 --- a/README.md +++ b/README.md @@ -1,118 +1,120 @@ # Conductor OSS Go SDK -Go SDK for working with https://github.com/conductor-oss/conductor. +SDK for developing Go applications that create, manage and execute workflows, and run workers. [Conductor](https://www.conductor-oss.org/) is the leading open-source orchestration platform allowing developers to build highly scalable distributed applications. -Check out the [official documentation for Conductor](https://orkes.io/content). - -## ⭐ Conductor OSS - -Show support for the Conductor OSS. Please help spread the awareness by starring Conductor repo. +To learn more about Conductor checkout our [developer's guide](https://docs.conductor-oss.org/devguide/concepts/index.html) and give it a ⭐ to make it famous! [![GitHub stars](https://img.shields.io/github/stars/conductor-oss/conductor.svg?style=social&label=Star&maxAge=)](https://GitHub.com/conductor-oss/conductor/) -## Content +# Content -- [Install Conductor Go SDK](#install-conductor-go-sdk) - - [Get Conductor Go SDK](#get-conductor-go-sdk) -- [Hello World Application Using Conductor](#hello-world-application-using-conductor) - - [Step 1: Create Workflow](#step-1-create-workflow) - - [Creating Workflows by Code](#creating-workflows-by-code) - - [(Alternatively) Creating Workflows in JSON](#alternatively-creating-workflows-in-json) - - [Step 2: Write Task Worker](#step-2-write-task-worker) - - [Step 3: Write _Hello World_ Application](#step-3-write-_hello-world_-application) -- [Running Workflows on Conductor Standalone (Installed Locally)](#running-workflows-on-conductor-standalone-installed-locally) - - [Setup Environment Variable](#setup-environment-variable) - - [Start Conductor Server](#start-conductor-server) - - [Execute Hello World Application](#execute-hello-world-application) -- [Running Workflows on Orkes Conductor](#running-workflows-on-orkes-conductor) -- [Learn More about Conductor Go SDK](#learn-more-about-conductor-go-sdk) +- [Installation](#installation) +- [Hello World!](#hello-world) + - [Step 1: Creating the workflow by code](#step-1-creating-the-workflow-by-code) + - [Step 2: Creating the worker](#step-2-write-task-worker) + - [Step 3: Running the application](#step-3-running-the-application) +- [API Documentation](#api-documentation) +## Installation - -## Install Conductor Go SDK - -Before installing Conductor Go SDK, it is a good practice to set up a dedicated folder for it. +1. Initialize your module. e.g.: ```shell -mkdir quickstart/ -cd quickstart/ -go mod init quickstart +mkdir hello_world +cd hello_world +go mod init hello_world ``` -### Get Conductor Go SDK +2. Get the SDK: -The SDK requires Go. To install the SDK, use the following command ```shell go get github.com/conductor-sdk/conductor-go ``` -## Hello World Application Using Conductor -In this section, we will create a simple "Hello World" application that executes a "greetings" workflow managed by Conductor. +## Hello World -### Step 1: Create Workflow +In this repo you will find a basic "Hello World" under [examples/hello_world](examples/hello_world/). -#### Creating Workflows by Code +Let's analyze the app in 3 steps. -Create workflow/workflow.go with the following: -```go -package workflow +> [!note] +> You will need an up & running Conductor Server. +> +> For details on how to run Conductor take a look at [our guide](https://conductor-oss.github.io/conductor/devguide/running/docker.html). +> +> The examples expect the server to be listening on http://localhost:8080. -import ( - "github.com/conductor-sdk/conductor-go/sdk/model" - "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/sdk/workflow/executor" -) -// Name struct that represents the input to the workflow -type NameInput struct { - Name string -} +### Step 1: Creating the workflow by code -func GetTaskDefinitions() []model.TaskDef { - taskDefs := []model.TaskDef{ - {Name: "greet", TimeoutSeconds: 60}, - } - return taskDefs -} +The "greetings" workflow is going to be created by code and registered in Conductor. -// Create a workflow and register it with the server -func CreateWorkflow(executor *executor.WorkflowExecutor) *workflow.ConductorWorkflow { +Check the `CreateWorkflow` function in [examples/hello_world/src/workflow.go](examples/hello_world/src/workflow.go). +```go +func CreateWorkflow(executor *executor.WorkflowExecutor) *workflow.ConductorWorkflow { wf := workflow.NewConductorWorkflow(executor). Name("greetings"). Version(1). Description("Greetings workflow - Greets a user by their name"). TimeoutPolicy(workflow.TimeOutWorkflow, 600) - //Greet Task greet := workflow.NewSimpleTask("greet", "greet_ref"). - Input("name", "${workflow.input.Name}") + Input("person_to_be_greated", "${workflow.input.name}") - //Add tasks to workflow wf.Add(greet) - //Add the output of the workflow from the task + wf.OutputParameters(map[string]interface{}{ - "Greetings": greet.OutputRef("greetings"), + "greetings": greet.OutputRef("hello"), }) + return wf } ``` -#### (Alternatively) Creating Workflows in JSON +In the above code first we create a workflow by calling `workflow.NewConductorWorkflow(..)` and set its properties `Name`, `Version`, `Description` and `TimeoutPolicy`. + +Then we create a [Simple Task](https://orkes.io/content/reference-docs/worker-task) of type `"greet"` with reference name `"greet_ref"` and add it to the workflow. That task gets the workflow input `"name"` as an input with key `"person_to_be_greated"`. + +> [!note] +>`"person_to_be_greated"` is too verbose! Why would you name it like that? +> +> It's just to make it clear that the workflow input is not passed automatically. +> +> The worker will get the actual value of the workflow input because of this mapping `Input("person_to_be_greated", "${workflow.input.name}")` in the workflow definition. +> +>Expressions like `"${workflow.input.name}"` will be replaced by their value during execution. + +Last but not least, the output of the workflow is set by calling `wf.OutputParameters(..)`. + +The value of `"greetings"` is going to be whatever `"hello"` is in the output of the executed `"greet"` task, e.g.: if the task output is: +``` +{ + "hello" : "Hello, John" +} +``` + +The expected workflow output will be: +``` +{ + "greetings": "Hello, John" +} +``` -Create `greetings_workflow.json` with the following: +The Go code translates to this JSON defininition. You can view this in your Conductor server after registering the workflow. ```json { + "schemaVersion": 2, "name": "greetings", - "description": "Sample greetings workflow", + "description": "Greetings workflow - Greets a user by their name", "version": 1, "tasks": [ { @@ -124,179 +126,163 @@ Create `greetings_workflow.json` with the following: } } ], + "outputParameters": { + "Greetings": "${greet_ref.output.greetings}" + }, "timeoutPolicy": "TIME_OUT_WF", - "timeoutSeconds": 60 + "timeoutSeconds": 600 } ``` -Workflows must be registered to the Conductor server. Use the API to register the greetings workflow from the JSON file above: -```shell -curl -X POST -H "Content-Type:application/json" \ -http://localhost:8080/api/metadata/workflow -d @greetings_workflow.json -``` > [!note] -> To use the Conductor API, the Conductor server must be up and running (see [Running over Conductor standalone (installed locally)](#running-over-conductor-standalone-installed-locally)). +> Workflows can also be registered using the API. Using the JSON you can make the following request: +> ```shell +> curl -X POST -H "Content-Type:application/json" \ +> http://localhost:8080/api/metadata/workflow -d @greetings_workflow.json +> ``` -### Step 2: Write Task Worker +In [Step 3](#step-3-running-the-application) you will see how to create an instance of `executor.WorkflowExecutor`. -Using Go, a worker represents a function with a specific task to perform. Create greet/greet.go -> [!note] -> A single workflow can have task workers written in different languages and deployed anywhere, making your workflow polyglot and distributed! +### Step 2: Creating the worker -```go -package greet +A worker is a function with a specific task to perform. -import ( - "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model" -) +In this example the worker just uses the input `person_to_be_greated` to say hello, as you can see in [examples/hello_world/src/worker.go](examples/hello_world/src/worker.go). -// Task worker +```go func Greet(task *model.Task) (interface{}, error) { return map[string]interface{}{ - "greetings": "Hello, " + fmt.Sprintf("%v", task.InputData["name"]), + "hello": "Hello, " + fmt.Sprintf("%v", task.InputData["person_to_be_greated"]), }, nil } ``` -Now, we are ready to write our main application, which will execute our workflow. - -### Step 3: Write _Hello World_ Application +> [!note] +> A single workflow can have task workers written in different languages and deployed anywhere, making your workflow polyglot and distributed! -Let's add main.go with a `main` method: +### Step 3: Running the application -```go -package main +The application is going to start the Greet worker (to execute tasks of type "greet") and it will register the workflow created in [step 1](#step-1-creating-the-workflow-by-code). -import ( - "fmt" - "os" - "quickstart/greet" - "quickstart/workflow" - "time" +To begin with, let's take a look at the variable declaration in [examples/hello_world/main.go](examples/hello_world/main.go). - "github.com/conductor-sdk/conductor-go/sdk/client" - "github.com/conductor-sdk/conductor-go/sdk/settings" - - "github.com/conductor-sdk/conductor-go/sdk/worker" - "github.com/conductor-sdk/conductor-go/sdk/workflow/executor" -) +```go var ( apiClient = client.NewAPIClient( - settings.NewAuthenticationSettings( - os.Getenv("KEY"), - os.Getenv("SECRET"), - ), - settings.NewHttpSettings( - os.Getenv("CONDUCTOR_SERVER_URL"), - )) + authSettings(), + httpSettings(), + ) taskRunner = worker.NewTaskRunnerWithApiClient(apiClient) workflowExecutor = executor.NewWorkflowExecutor(apiClient) - metadataClient = client.MetadataResourceApiService{APIClient: apiClient} ) -func StartWorkers() { - taskRunner.StartWorker("greet", greet.Greet, 1, time.Millisecond*100) -} +func authSettings() *settings.AuthenticationSettings { + key := os.Getenv("KEY") + secret := os.Getenv("SECRET") + if key != "" && secret != "" { + return settings.NewAuthenticationSettings( + key, + secret, + ) + } -func main() { + return nil +} - //Start the workers - StartWorkers() - /* This is used to register the Workflow, it's a one-time process. Comment from here */ - wf := workflow.CreateWorkflow(workflowExecutor) - err := wf.Register(false) - if err != nil { - fmt.Println(err.Error()) - return - } - /* Till Here after registering the workflow*/ - id, err := wf.StartWorkflowWithInput(&workflow.NameInput{ - Name: "Orkes", - }) - if err != nil { - fmt.Println(err.Error()) - return +func httpSettings() *settings.HttpSettings { + url := os.Getenv("CONDUCTOR_SERVER_URL") + if url == "" { + fmt.Fprintf(os.Stderr, "Error: CONDUCTOR_SERVER_URL env variable is not set\n") + os.Exit(1) } - fmt.Println("Started workflow with Id: ", id) - - /*Get a channel to monitor the workflow execution - - Note: This is useful in case of short duration workflows that completes in few seconds.*/ - channel, _ := workflowExecutor.MonitorExecution(id) - run := <-channel - fmt.Println("Output of the workflow, ", run.Status) + return settings.NewHttpSettings(url) } ``` -## Running Workflows on Conductor Standalone (Installed Locally) +First we create an `APIClient` instance. This is a REST client. -### Setup Environment Variable +We need to pass on the proper settings to our client. For convenience to run the example you can set the following environment variables: `CONDUCTOR_SERVER_URL`, `KEY`, `SECRET`. -Set the following environment variable to point the SDK to the Conductor Server API endpoint: -```shell -export CONDUCTOR_SERVER_URL=http://localhost:8080/api -``` -> [!NOTE] -> To setup the required dependencies use `go mod tidy` +Now let's take a look at the `main` function: -### Start Conductor Server - -To start the Conductor server in a standalone mode from a Docker image, type the command below: +```go +func main() { + // Start the Greet Worker. This worker will process "greet" tasks. + taskRunner.StartWorker("greet", hello_world.Greet, 1, time.Millisecond*100) -```shell -docker run --init -p 8080:8080 -p 5000:5000 conductoross/conductor-standalone:3.15.0 -``` -To ensure the server has started successfully, open Conductor UI on http://localhost:5000. + // This is used to register the Workflow, it's a one-time process. You can comment from here + wf := hello_world.CreateWorkflow(workflowExecutor) + err := wf.Register(true) + if err != nil { + log.Error(err.Error()) + return + } + // Till Here after registering the workflow + + // Start the greetings workflow + id, err := workflowExecutor.StartWorkflow( + &model.StartWorkflowRequest{ + Name: "greetings", + Version: 1, + Input: map[string]string{ + "name": "Gopher", + }, + }, + ) -### Execute Hello World Application + if err != nil { + log.Error(err.Error()) + return + } -To run the application, type the following command: + log.Info("Started workflow with Id: ", id) -```shell -go run main.go + // Get a channel to monitor the workflow execution - + // Note: This is useful in case of short duration workflows that completes in few seconds. + channel, _ := workflowExecutor.MonitorExecution(id) + run := <-channel + log.Info("Output of the workflow: ", run.Output) +} ``` -Now, the workflow is executed, and its execution status can be viewed from Conductor UI (http://localhost:5000). - -Navigate to the **Executions** tab to view the workflow execution. - -Screenshot 2024-04-16 at 10 21 43 PM -## Running Workflows on Orkes Conductor +The `taskRunner` uses the `apiClient` to poll for work and complete tasks. It also starts the worker and handles concurrency and polling intervals for us based on the configuration provided. -For running the workflow in Orkes Conductor, +That simple line `taskRunner.StartWorker("greet", hello_world.Greet, 1, time.Millisecond*100)` is all that's needed to get our Greet worker up & running and processing tasks of type `"greet"`. -- Update the Conductor server URL to your cluster name. +The `workflowExecutor` gives us an abstraction on top of the `apiClient` to manage workflows. It is used under the hood by `ConductorWorkflow` to register the workflow and it's also used to start and monitor the execution. +#### Running the example with a local Conductor OSS server: ```shell -export CONDUCTOR_SERVER_URL=https://[cluster-name].orkesconductor.io/api +export CONDUCTOR_SERVER_URL="http://localhost:8080/api" +cd examples +go run hello_world/main.go ``` -- If you want to run the workflow on the Orkes Conductor Playground, set the Conductor Server variable as follows: +#### Running the example in Orkes playground. ```shell -export CONDUCTOR_SERVER_URL=https://play.orkes.io/api +export CONDUCTOR_SERVER_URL="https://play.orkes.io/api" +export KEY="..." +export SECRET="..." +cd examples +go run hello_world/main.go ``` -- Orkes Conductor requires authentication. [Obtain the key and secret from the Conductor server](https://orkes.io/content/how-to-videos/access-key-and-secret) and set the following environment variables. +> [!note] +> Orkes Conductor requires authentication. [Get a key and secret from the server](https://orkes.io/content/how-to-videos/access-key-and-secret) to set those variables. +The above commands should give an output similar to ```shell -export CONDUCTOR_AUTH_KEY=your_key -export CONDUCTOR_AUTH_SECRET=your_key_secret +INFO[0000] Updated poll interval for task: greet, to: 100ms +INFO[0000] Started 1 worker(s) for taskName greet, polling in interval of 100 ms +INFO[0000] Started workflow with Id:14a9fcc5-3d74-11ef-83dc-acde48001122 +INFO[0000] Output of the workflow:map[Greetings:Hello, Gopher] ``` -Run the application and view the execution status from Conductor's UI Console. - -> [!NOTE] -> That's it - you just created and executed your first distributed Go app! - -## Learn More about Conductor Go SDK - -There are three main ways you can use Conductor when building durable, resilient, distributed applications. +# API Documentation -1. Write service workers that implement business logic to accomplish a specific goal - such as initiating payment transfer, getting user information from the database, etc. -2. Create Conductor workflows that implement application state - A typical workflow implements the saga pattern. -3. Use Conductor SDK and APIs to manage workflows from your application. +You can find the SDK API documentation [here](https://pkg.go.dev/github.com/conductor-sdk/conductor-go). diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 001824a1..00000000 --- a/docs/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# SDK API Documentation -### [Workflow Management](executor.md) -### [Task Worker](worker.md) -### [Workflow Authoring](workflow.md) -### [Settings](settings.md) -### [Conductor Client](client.md) \ No newline at end of file diff --git a/docs/client.md b/docs/client.md deleted file mode 100644 index 0e973161..00000000 --- a/docs/client.md +++ /dev/null @@ -1,1840 +0,0 @@ - - -# client - -```go -import "github.com/conductor-sdk/conductor-go/sdk/client" -``` - -Licensed under the Apache License, Version 2.0 \(the "License"\); you may not use this file except in compliance with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -- Orkes Conductor API Server \* -- Orkes Conductor API Server \* -- API version: v2 -- Generated by: Swagger Codegen \(https://github.com/swagger-api/swagger-codegen.git\) - -## Index - -- [func CacheExpires\(r \*http.Response\) time.Time](<#CacheExpires>) -- [type APIClient](<#APIClient>) - - [func NewAPIClient\(authenticationSettings \*settings.AuthenticationSettings, httpSettings \*settings.HttpSettings\) \*APIClient](<#NewAPIClient>) - - [func NewAPIClientWithTokenExpiration\(authenticationSettings \*settings.AuthenticationSettings, httpSettings \*settings.HttpSettings, tokenExpiration \*authentication.TokenExpiration\) \*APIClient](<#NewAPIClientWithTokenExpiration>) -- [type EventResourceApiGetEventHandlersForEventOpts](<#EventResourceApiGetEventHandlersForEventOpts>) -- [type EventResourceApiService](<#EventResourceApiService>) - - [func \(a \*EventResourceApiService\) AddEventHandler\(ctx context.Context, body model.EventHandler\) \(\*http.Response, error\)](<#EventResourceApiService.AddEventHandler>) - - [func \(a \*EventResourceApiService\) DeleteQueueConfig\(ctx context.Context, queueType string, queueName string\) \(\*http.Response, error\)](<#EventResourceApiService.DeleteQueueConfig>) - - [func \(a \*EventResourceApiService\) GetEventHandlers\(ctx context.Context\) \(\[\]model.EventHandler, \*http.Response, error\)](<#EventResourceApiService.GetEventHandlers>) - - [func \(a \*EventResourceApiService\) GetEventHandlersForEvent\(ctx context.Context, event string, localVarOptionals \*EventResourceApiGetEventHandlersForEventOpts\) \(\[\]model.EventHandler, \*http.Response, error\)](<#EventResourceApiService.GetEventHandlersForEvent>) - - [func \(a \*EventResourceApiService\) GetQueueConfig\(ctx context.Context, queueType string, queueName string\) \(map\[string\]interface\{\}, \*http.Response, error\)](<#EventResourceApiService.GetQueueConfig>) - - [func \(a \*EventResourceApiService\) GetQueueNames\(ctx context.Context\) \(map\[string\]string, \*http.Response, error\)](<#EventResourceApiService.GetQueueNames>) - - [func \(a \*EventResourceApiService\) PutQueueConfig\(ctx context.Context, body string, queueType string, queueName string\) \(\*http.Response, error\)](<#EventResourceApiService.PutQueueConfig>) - - [func \(a \*EventResourceApiService\) RemoveEventHandlerStatus\(ctx context.Context, name string\) \(\*http.Response, error\)](<#EventResourceApiService.RemoveEventHandlerStatus>) - - [func \(a \*EventResourceApiService\) UpdateEventHandler\(ctx context.Context, body model.EventHandler\) \(\*http.Response, error\)](<#EventResourceApiService.UpdateEventHandler>) -- [type GenericSwaggerError](<#GenericSwaggerError>) - - [func \(e GenericSwaggerError\) Body\(\) \[\]byte](<#GenericSwaggerError.Body>) - - [func \(e GenericSwaggerError\) Error\(\) string](<#GenericSwaggerError.Error>) - - [func \(e GenericSwaggerError\) Model\(\) interface\{\}](<#GenericSwaggerError.Model>) -- [type GetAllSchedulesOpts](<#GetAllSchedulesOpts>) -- [type HealthCheckResourceApiService](<#HealthCheckResourceApiService>) - - [func \(a \*HealthCheckResourceApiService\) DoCheck\(ctx context.Context\) \(model.HealthCheckStatus, \*http.Response, error\)](<#HealthCheckResourceApiService.DoCheck>) -- [type HttpRequester](<#HttpRequester>) - - [func NewHttpRequester\(authenticationSettings \*settings.AuthenticationSettings, httpSettings \*settings.HttpSettings, httpClient \*http.Client, tokenExpiration \*authentication.TokenExpiration\) \*HttpRequester](<#NewHttpRequester>) -- [type MetadataResourceApiGetOpts](<#MetadataResourceApiGetOpts>) -- [type MetadataResourceApiService](<#MetadataResourceApiService>) - - [func \(a \*MetadataResourceApiService\) Get\(ctx context.Context, name string, localVarOptionals \*MetadataResourceApiGetOpts\) \(model.WorkflowDef, \*http.Response, error\)](<#MetadataResourceApiService.Get>) - - [func \(a \*MetadataResourceApiService\) GetAll\(ctx context.Context\) \(\[\]model.WorkflowDef, \*http.Response, error\)](<#MetadataResourceApiService.GetAll>) - - [func \(a \*MetadataResourceApiService\) GetTagsForTaskDef\(ctx context.Context, tasktype string\) \(\[\]model.MetadataTag, error\)](<#MetadataResourceApiService.GetTagsForTaskDef>) - - [func \(a \*MetadataResourceApiService\) GetTagsForWorkflowDef\(ctx context.Context, name string\) \(\[\]model.MetadataTag, error\)](<#MetadataResourceApiService.GetTagsForWorkflowDef>) - - [func \(a \*MetadataResourceApiService\) GetTaskDef\(ctx context.Context, tasktype string\) \(model.TaskDef, \*http.Response, error\)](<#MetadataResourceApiService.GetTaskDef>) - - [func \(a \*MetadataResourceApiService\) GetTaskDefs\(ctx context.Context\) \(\[\]model.TaskDef, \*http.Response, error\)](<#MetadataResourceApiService.GetTaskDefs>) - - [func \(a \*MetadataResourceApiService\) RegisterTaskDef\(ctx context.Context, body \[\]model.TaskDef\) \(\*http.Response, error\)](<#MetadataResourceApiService.RegisterTaskDef>) - - [func \(a \*MetadataResourceApiService\) RegisterTaskDefWithTags\(ctx context.Context, body model.TaskDef, tags \[\]model.MetadataTag\) \(\*http.Response, error\)](<#MetadataResourceApiService.RegisterTaskDefWithTags>) - - [func \(a \*MetadataResourceApiService\) RegisterWorkflowDef\(ctx context.Context, overwrite bool, body model.WorkflowDef\) \(\*http.Response, error\)](<#MetadataResourceApiService.RegisterWorkflowDef>) - - [func \(a \*MetadataResourceApiService\) RegisterWorkflowDefWithTags\(ctx context.Context, overwrite bool, body model.WorkflowDef, tags \[\]model.MetadataTag\) \(\*http.Response, error\)](<#MetadataResourceApiService.RegisterWorkflowDefWithTags>) - - [func \(a \*MetadataResourceApiService\) UnregisterTaskDef\(ctx context.Context, tasktype string\) \(\*http.Response, error\)](<#MetadataResourceApiService.UnregisterTaskDef>) - - [func \(a \*MetadataResourceApiService\) UnregisterWorkflowDef\(ctx context.Context, name string, version int32\) \(\*http.Response, error\)](<#MetadataResourceApiService.UnregisterWorkflowDef>) - - [func \(a \*MetadataResourceApiService\) Update\(ctx context.Context, body \[\]model.WorkflowDef\) \(\*http.Response, error\)](<#MetadataResourceApiService.Update>) - - [func \(a \*MetadataResourceApiService\) UpdateTaskDef\(ctx context.Context, body model.TaskDef\) \(\*http.Response, error\)](<#MetadataResourceApiService.UpdateTaskDef>) - - [func \(a \*MetadataResourceApiService\) UpdateTaskDefWithTags\(ctx context.Context, body model.TaskDef, tags \[\]model.MetadataTag, overwriteTags bool\) \(\*http.Response, error\)](<#MetadataResourceApiService.UpdateTaskDefWithTags>) - - [func \(a \*MetadataResourceApiService\) UpdateWorkflowDefWithTags\(ctx context.Context, body model.WorkflowDef, tags \[\]model.MetadataTag, overwriteTags bool\) \(\*http.Response, error\)](<#MetadataResourceApiService.UpdateWorkflowDefWithTags>) -- [type NextFewSchedulesOpts](<#NextFewSchedulesOpts>) -- [type SchedulerClient](<#SchedulerClient>) - - [func GetSchedulerService\(client \*APIClient\) SchedulerClient](<#GetSchedulerService>) -- [type SchedulerResourceApiService](<#SchedulerResourceApiService>) - - [func \(a \*SchedulerResourceApiService\) AddTagForSchedule\(ctx context.Context, body \[\]model.Tag, name string\) \(\*http.Response, error\)](<#SchedulerResourceApiService.AddTagForSchedule>) - - [func \(a \*SchedulerResourceApiService\) DeleteSchedule\(ctx context.Context, name string\) \(\*http.Response, error\)](<#SchedulerResourceApiService.DeleteSchedule>) - - [func \(a \*SchedulerResourceApiService\) DeleteTagForSchedule\(ctx context.Context, tags \[\]model.Tag, name string\) \(\*http.Response, error\)](<#SchedulerResourceApiService.DeleteTagForSchedule>) - - [func \(a \*SchedulerResourceApiService\) GetAllSchedules\(ctx context.Context, localVarOptionals \*GetAllSchedulesOpts\) \(\[\]model.WorkflowSchedule, \*http.Response, error\)](<#SchedulerResourceApiService.GetAllSchedules>) - - [func \(a \*SchedulerResourceApiService\) GetNextFewSchedules\(ctx context.Context, cronExpression string, localVarOptionals \*NextFewSchedulesOpts\) \(\[\]int64, \*http.Response, error\)](<#SchedulerResourceApiService.GetNextFewSchedules>) - - [func \(a \*SchedulerResourceApiService\) GetSchedule\(ctx context.Context, name string\) \(model.WorkflowSchedule, \*http.Response, error\)](<#SchedulerResourceApiService.GetSchedule>) - - [func \(a \*SchedulerResourceApiService\) GetTagsForSchedule\(ctx context.Context, name string\) \(\[\]model.Tag, \*http.Response, error\)](<#SchedulerResourceApiService.GetTagsForSchedule>) - - [func \(a \*SchedulerResourceApiService\) PauseAllSchedules\(ctx context.Context\) \(map\[string\]interface\{\}, \*http.Response, error\)](<#SchedulerResourceApiService.PauseAllSchedules>) - - [func \(a \*SchedulerResourceApiService\) PauseSchedule\(ctx context.Context, name string\) \(\*http.Response, error\)](<#SchedulerResourceApiService.PauseSchedule>) - - [func \(a \*SchedulerResourceApiService\) ResumeAllSchedules\(ctx context.Context\) \(map\[string\]interface\{\}, \*http.Response, error\)](<#SchedulerResourceApiService.ResumeAllSchedules>) - - [func \(a \*SchedulerResourceApiService\) ResumeSchedule\(ctx context.Context, name string\) \(\*http.Response, error\)](<#SchedulerResourceApiService.ResumeSchedule>) - - [func \(a \*SchedulerResourceApiService\) SaveSchedule\(ctx context.Context, body model.SaveScheduleRequest\) \(\*http.Response, error\)](<#SchedulerResourceApiService.SaveSchedule>) - - [func \(a \*SchedulerResourceApiService\) Search\(ctx context.Context, localVarOptionals \*SchedulerSearchOpts\) \(model.SearchResultWorkflowSchedule, \*http.Response, error\)](<#SchedulerResourceApiService.Search>) -- [type SchedulerSearchOpts](<#SchedulerSearchOpts>) -- [type TagsApiService](<#TagsApiService>) - - [func \(a \*TagsApiService\) AddTaskTag\(ctx context.Context, body model.TagObject, taskName string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.AddTaskTag>) - - [func \(a \*TagsApiService\) AddWorkflowTag\(ctx context.Context, body model.TagObject, name string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.AddWorkflowTag>) - - [func \(a \*TagsApiService\) DeleteTaskTag\(ctx context.Context, body model.TagString, taskName string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.DeleteTaskTag>) - - [func \(a \*TagsApiService\) DeleteWorkflowTag\(ctx context.Context, body model.TagObject, name string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.DeleteWorkflowTag>) - - [func \(a \*TagsApiService\) GetTags1\(ctx context.Context\) \(\[\]model.TagObject, \*http.Response, error\)](<#TagsApiService.GetTags1>) - - [func \(a \*TagsApiService\) GetTaskTags\(ctx context.Context, taskName string\) \(\[\]model.TagObject, \*http.Response, error\)](<#TagsApiService.GetTaskTags>) - - [func \(a \*TagsApiService\) GetWorkflowTags\(ctx context.Context, name string\) \(\[\]model.TagObject, \*http.Response, error\)](<#TagsApiService.GetWorkflowTags>) - - [func \(a \*TagsApiService\) SetTaskTags\(ctx context.Context, body \[\]model.TagObject, taskName string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.SetTaskTags>) - - [func \(a \*TagsApiService\) SetWorkflowTags\(ctx context.Context, body \[\]model.TagObject, name string\) \(interface\{\}, \*http.Response, error\)](<#TagsApiService.SetWorkflowTags>) -- [type TaskResourceApiBatchPollOpts](<#TaskResourceApiBatchPollOpts>) -- [type TaskResourceApiPollOpts](<#TaskResourceApiPollOpts>) -- [type TaskResourceApiSearch1Opts](<#TaskResourceApiSearch1Opts>) -- [type TaskResourceApiSearchV21Opts](<#TaskResourceApiSearchV21Opts>) -- [type TaskResourceApiService](<#TaskResourceApiService>) - - [func \(a \*TaskResourceApiService\) All\(ctx context.Context\) \(map\[string\]int64, \*http.Response, error\)](<#TaskResourceApiService.All>) - - [func \(a \*TaskResourceApiService\) AllVerbose\(ctx context.Context\) \(map\[string\]map\[string\]map\[string\]int64, \*http.Response, error\)](<#TaskResourceApiService.AllVerbose>) - - [func \(a \*TaskResourceApiService\) BatchPoll\(ctx context.Context, tasktype string, localVarOptionals \*TaskResourceApiBatchPollOpts\) \(\[\]model.Task, \*http.Response, error\)](<#TaskResourceApiService.BatchPoll>) - - [func \(a \*TaskResourceApiService\) GetAllPollData\(ctx context.Context\) \(\[\]model.PollData, \*http.Response, error\)](<#TaskResourceApiService.GetAllPollData>) - - [func \(a \*TaskResourceApiService\) GetExternalStorageLocation1\(ctx context.Context, path string, operation string, payloadType string\) \(model.ExternalStorageLocation, \*http.Response, error\)](<#TaskResourceApiService.GetExternalStorageLocation1>) - - [func \(a \*TaskResourceApiService\) GetPollData\(ctx context.Context, taskType string\) \(\[\]model.PollData, \*http.Response, error\)](<#TaskResourceApiService.GetPollData>) - - [func \(a \*TaskResourceApiService\) GetTask\(ctx context.Context, taskId string\) \(model.Task, \*http.Response, error\)](<#TaskResourceApiService.GetTask>) - - [func \(a \*TaskResourceApiService\) GetTaskLogs\(ctx context.Context, taskId string\) \(\[\]model.TaskExecLog, \*http.Response, error\)](<#TaskResourceApiService.GetTaskLogs>) - - [func \(a \*TaskResourceApiService\) Log\(ctx context.Context, body string, taskId string\) \(\*http.Response, error\)](<#TaskResourceApiService.Log>) - - [func \(a \*TaskResourceApiService\) Poll\(ctx context.Context, tasktype string, localVarOptionals \*TaskResourceApiPollOpts\) \(model.Task, \*http.Response, error\)](<#TaskResourceApiService.Poll>) - - [func \(a \*TaskResourceApiService\) RequeuePendingTask\(ctx context.Context, taskType string\) \(string, \*http.Response, error\)](<#TaskResourceApiService.RequeuePendingTask>) - - [func \(a \*TaskResourceApiService\) Search1\(ctx context.Context, localVarOptionals \*TaskResourceApiSearch1Opts\) \(model.SearchResultTaskSummary, \*http.Response, error\)](<#TaskResourceApiService.Search1>) - - [func \(a \*TaskResourceApiService\) SearchV21\(ctx context.Context, localVarOptionals \*TaskResourceApiSearchV21Opts\) \(model.SearchResultTask, \*http.Response, error\)](<#TaskResourceApiService.SearchV21>) - - [func \(a \*TaskResourceApiService\) Size\(ctx context.Context, localVarOptionals \*TaskResourceApiSizeOpts\) \(map\[string\]int32, \*http.Response, error\)](<#TaskResourceApiService.Size>) - - [func \(a \*TaskResourceApiService\) UpdateTask\(ctx context.Context, taskResult \*model.TaskResult\) \(string, \*http.Response, error\)](<#TaskResourceApiService.UpdateTask>) - - [func \(a \*TaskResourceApiService\) UpdateTaskByRefName\(ctx context.Context, body map\[string\]interface\{\}, workflowId string, taskRefName string, status string\) \(string, \*http.Response, error\)](<#TaskResourceApiService.UpdateTaskByRefName>) - - [func \(a \*TaskResourceApiService\) UpdateTaskByRefNameWithWorkerId\(ctx context.Context, body map\[string\]interface\{\}, workflowId string, taskRefName string, status string, workerId optional.String\) \(string, \*http.Response, error\)](<#TaskResourceApiService.UpdateTaskByRefNameWithWorkerId>) -- [type TaskResourceApiSizeOpts](<#TaskResourceApiSizeOpts>) -- [type WorkflowBulkResourceApiRestart1Opts](<#WorkflowBulkResourceApiRestart1Opts>) -- [type WorkflowBulkResourceApiService](<#WorkflowBulkResourceApiService>) - - [func \(a \*WorkflowBulkResourceApiService\) PauseWorkflow1\(ctx context.Context, body \[\]string\) \(model.BulkResponse, \*http.Response, error\)](<#WorkflowBulkResourceApiService.PauseWorkflow1>) - - [func \(a \*WorkflowBulkResourceApiService\) Restart1\(ctx context.Context, body \[\]string, localVarOptionals \*WorkflowBulkResourceApiRestart1Opts\) \(model.BulkResponse, \*http.Response, error\)](<#WorkflowBulkResourceApiService.Restart1>) - - [func \(a \*WorkflowBulkResourceApiService\) ResumeWorkflow1\(ctx context.Context, body \[\]string\) \(model.BulkResponse, \*http.Response, error\)](<#WorkflowBulkResourceApiService.ResumeWorkflow1>) - - [func \(a \*WorkflowBulkResourceApiService\) Retry1\(ctx context.Context, body \[\]string\) \(model.BulkResponse, \*http.Response, error\)](<#WorkflowBulkResourceApiService.Retry1>) - - [func \(a \*WorkflowBulkResourceApiService\) Terminate\(ctx context.Context, body \[\]string, localVarOptionals \*WorkflowBulkResourceApiTerminateOpts\) \(model.BulkResponse, \*http.Response, error\)](<#WorkflowBulkResourceApiService.Terminate>) -- [type WorkflowBulkResourceApiTerminateOpts](<#WorkflowBulkResourceApiTerminateOpts>) -- [type WorkflowResourceApiDeleteOpts](<#WorkflowResourceApiDeleteOpts>) -- [type WorkflowResourceApiGetExecutionStatusOpts](<#WorkflowResourceApiGetExecutionStatusOpts>) -- [type WorkflowResourceApiGetRunningWorkflowOpts](<#WorkflowResourceApiGetRunningWorkflowOpts>) -- [type WorkflowResourceApiGetWorkflows1Opts](<#WorkflowResourceApiGetWorkflows1Opts>) -- [type WorkflowResourceApiGetWorkflowsOpts](<#WorkflowResourceApiGetWorkflowsOpts>) -- [type WorkflowResourceApiRestartOpts](<#WorkflowResourceApiRestartOpts>) -- [type WorkflowResourceApiRetryOpts](<#WorkflowResourceApiRetryOpts>) -- [type WorkflowResourceApiSearchOpts](<#WorkflowResourceApiSearchOpts>) -- [type WorkflowResourceApiSearchV2Opts](<#WorkflowResourceApiSearchV2Opts>) -- [type WorkflowResourceApiSearchWorkflowsByTasksOpts](<#WorkflowResourceApiSearchWorkflowsByTasksOpts>) -- [type WorkflowResourceApiSearchWorkflowsByTasksV2Opts](<#WorkflowResourceApiSearchWorkflowsByTasksV2Opts>) -- [type WorkflowResourceApiService](<#WorkflowResourceApiService>) - - [func \(a \*WorkflowResourceApiService\) Decide\(ctx context.Context, workflowId string\) \(\*http.Response, error\)](<#WorkflowResourceApiService.Decide>) - - [func \(a \*WorkflowResourceApiService\) Delete\(ctx context.Context, workflowId string, localVarOptionals \*WorkflowResourceApiDeleteOpts\) \(\*http.Response, error\)](<#WorkflowResourceApiService.Delete>) - - [func \(a \*WorkflowResourceApiService\) ExecuteWorkflow\(ctx context.Context, body model.StartWorkflowRequest, requestId string, name string, version int32, waitUntilTask string\) \(model.WorkflowRun, \*http.Response, error\)](<#WorkflowResourceApiService.ExecuteWorkflow>) - - [func \(a \*WorkflowResourceApiService\) GetExecutionStatus\(ctx context.Context, workflowId string, localVarOptionals \*WorkflowResourceApiGetExecutionStatusOpts\) \(model.Workflow, \*http.Response, error\)](<#WorkflowResourceApiService.GetExecutionStatus>) - - [func \(a \*WorkflowResourceApiService\) GetExternalStorageLocation\(ctx context.Context, path string, operation string, payloadType string\) \(model.ExternalStorageLocation, \*http.Response, error\)](<#WorkflowResourceApiService.GetExternalStorageLocation>) - - [func \(a \*WorkflowResourceApiService\) GetRunningWorkflow\(ctx context.Context, name string, localVarOptionals \*WorkflowResourceApiGetRunningWorkflowOpts\) \(\[\]string, \*http.Response, error\)](<#WorkflowResourceApiService.GetRunningWorkflow>) - - [func \(a \*WorkflowResourceApiService\) GetWorkflowState\(ctx context.Context, workflowId string, includeOutput bool, includeVariables bool\) \(model.WorkflowState, \*http.Response, error\)](<#WorkflowResourceApiService.GetWorkflowState>) - - [func \(a \*WorkflowResourceApiService\) GetWorkflows\(ctx context.Context, body \[\]string, name string, localVarOptionals \*WorkflowResourceApiGetWorkflowsOpts\) \(map\[string\]\[\]model.Workflow, \*http.Response, error\)](<#WorkflowResourceApiService.GetWorkflows>) - - [func \(a \*WorkflowResourceApiService\) GetWorkflows1\(ctx context.Context, name string, correlationId string, localVarOptionals \*WorkflowResourceApiGetWorkflows1Opts\) \(\[\]model.Workflow, \*http.Response, error\)](<#WorkflowResourceApiService.GetWorkflows1>) - - [func \(a \*WorkflowResourceApiService\) GetWorkflowsBatch\(ctx context.Context, body map\[string\]\[\]string, localVarOptionals \*WorkflowResourceApiGetWorkflowsOpts\) \(map\[string\]\[\]model.Workflow, \*http.Response, error\)](<#WorkflowResourceApiService.GetWorkflowsBatch>) - - [func \(a \*WorkflowResourceApiService\) PauseWorkflow\(ctx context.Context, workflowId string\) \(\*http.Response, error\)](<#WorkflowResourceApiService.PauseWorkflow>) - - [func \(a \*WorkflowResourceApiService\) Rerun\(ctx context.Context, body model.RerunWorkflowRequest, workflowId string\) \(string, \*http.Response, error\)](<#WorkflowResourceApiService.Rerun>) - - [func \(a \*WorkflowResourceApiService\) ResetWorkflow\(ctx context.Context, workflowId string\) \(\*http.Response, error\)](<#WorkflowResourceApiService.ResetWorkflow>) - - [func \(a \*WorkflowResourceApiService\) Restart\(ctx context.Context, workflowId string, localVarOptionals \*WorkflowResourceApiRestartOpts\) \(\*http.Response, error\)](<#WorkflowResourceApiService.Restart>) - - [func \(a \*WorkflowResourceApiService\) ResumeWorkflow\(ctx context.Context, workflowId string\) \(\*http.Response, error\)](<#WorkflowResourceApiService.ResumeWorkflow>) - - [func \(a \*WorkflowResourceApiService\) Retry\(ctx context.Context, workflowId string, localVarOptionals \*WorkflowResourceApiRetryOpts\) \(\*http.Response, error\)](<#WorkflowResourceApiService.Retry>) - - [func \(a \*WorkflowResourceApiService\) Search\(ctx context.Context, localVarOptionals \*WorkflowResourceApiSearchOpts\) \(model.SearchResultWorkflowSummary, \*http.Response, error\)](<#WorkflowResourceApiService.Search>) - - [func \(a \*WorkflowResourceApiService\) SearchV2\(ctx context.Context, localVarOptionals \*WorkflowResourceApiSearchV2Opts\) \(model.SearchResultWorkflow, \*http.Response, error\)](<#WorkflowResourceApiService.SearchV2>) - - [func \(a \*WorkflowResourceApiService\) SearchWorkflowsByTasks\(ctx context.Context, localVarOptionals \*WorkflowResourceApiSearchWorkflowsByTasksOpts\) \(model.SearchResultWorkflowSummary, \*http.Response, error\)](<#WorkflowResourceApiService.SearchWorkflowsByTasks>) - - [func \(a \*WorkflowResourceApiService\) SearchWorkflowsByTasksV2\(ctx context.Context, localVarOptionals \*WorkflowResourceApiSearchWorkflowsByTasksV2Opts\) \(model.SearchResultWorkflow, \*http.Response, error\)](<#WorkflowResourceApiService.SearchWorkflowsByTasksV2>) - - [func \(a \*WorkflowResourceApiService\) SkipTaskFromWorkflow\(ctx context.Context, workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest\) \(\*http.Response, error\)](<#WorkflowResourceApiService.SkipTaskFromWorkflow>) - - [func \(a \*WorkflowResourceApiService\) StartWorkflow\(ctx context.Context, body map\[string\]interface\{\}, name string, localVarOptionals \*WorkflowResourceApiStartWorkflowOpts\) \(string, \*http.Response, error\)](<#WorkflowResourceApiService.StartWorkflow>) - - [func \(a \*WorkflowResourceApiService\) StartWorkflowWithRequest\(ctx context.Context, body model.StartWorkflowRequest\) \(string, \*http.Response, error\)](<#WorkflowResourceApiService.StartWorkflowWithRequest>) - - [func \(a \*WorkflowResourceApiService\) Terminate\(ctx context.Context, workflowId string, localVarOptionals \*WorkflowResourceApiTerminateOpts\) \(\*http.Response, error\)](<#WorkflowResourceApiService.Terminate>) -- [type WorkflowResourceApiStartWorkflowOpts](<#WorkflowResourceApiStartWorkflowOpts>) -- [type WorkflowResourceApiTerminateOpts](<#WorkflowResourceApiTerminateOpts>) - - - -## func [CacheExpires]() - -```go -func CacheExpires(r *http.Response) time.Time -``` - -CacheExpires helper function to determine remaining time before repeating a request. - - -## type [APIClient]() - - - -```go -type APIClient struct { - // contains filtered or unexported fields -} -``` - - -### func [NewAPIClient]() - -```go -func NewAPIClient(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings) *APIClient -``` - - - - -### func [NewAPIClientWithTokenExpiration]() - -```go -func NewAPIClientWithTokenExpiration(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings, tokenExpiration *authentication.TokenExpiration) *APIClient -``` - - - - -## type [EventResourceApiGetEventHandlersForEventOpts]() - - - -```go -type EventResourceApiGetEventHandlersForEventOpts struct { - ActiveOnly optional.Bool -} -``` - - -## type [EventResourceApiService]() - - - -```go -type EventResourceApiService struct { - *APIClient -} -``` - - -### func \(\*EventResourceApiService\) [AddEventHandler]() - -```go -func (a *EventResourceApiService) AddEventHandler(ctx context.Context, body model.EventHandler) (*http.Response, error) -``` - -EventResourceApiService Add a new event handler. - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*EventResourceApiService\) [DeleteQueueConfig]() - -```go -func (a *EventResourceApiService) DeleteQueueConfig(ctx context.Context, queueType string, queueName string) (*http.Response, error) -``` - -EventResourceApiService Delete queue config by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param queueType -- @param queueName - - -### func \(\*EventResourceApiService\) [GetEventHandlers]() - -```go -func (a *EventResourceApiService) GetEventHandlers(ctx context.Context) ([]model.EventHandler, *http.Response, error) -``` - -EventResourceApiService Get all the event handlers - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return \[\]model.EventHandler - - -### func \(\*EventResourceApiService\) [GetEventHandlersForEvent]() - -```go -func (a *EventResourceApiService) GetEventHandlersForEvent(ctx context.Context, event string, localVarOptionals *EventResourceApiGetEventHandlersForEventOpts) ([]model.EventHandler, *http.Response, error) -``` - - - - -### func \(\*EventResourceApiService\) [GetQueueConfig]() - -```go -func (a *EventResourceApiService) GetQueueConfig(ctx context.Context, queueType string, queueName string) (map[string]interface{}, *http.Response, error) -``` - -EventResourceApiService Get queue config by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param queueType -- @param queueName - -@return map\[string\]interface\{\} - - -### func \(\*EventResourceApiService\) [GetQueueNames]() - -```go -func (a *EventResourceApiService) GetQueueNames(ctx context.Context) (map[string]string, *http.Response, error) -``` - -EventResourceApiService Get all queue configs - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return map\[string\]string - - -### func \(\*EventResourceApiService\) [PutQueueConfig]() - -```go -func (a *EventResourceApiService) PutQueueConfig(ctx context.Context, body string, queueType string, queueName string) (*http.Response, error) -``` - -EventResourceApiService Create or update queue config by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param queueType -- @param queueName - - -### func \(\*EventResourceApiService\) [RemoveEventHandlerStatus]() - -```go -func (a *EventResourceApiService) RemoveEventHandlerStatus(ctx context.Context, name string) (*http.Response, error) -``` - -EventResourceApiService Remove an event handler - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - - -### func \(\*EventResourceApiService\) [UpdateEventHandler]() - -```go -func (a *EventResourceApiService) UpdateEventHandler(ctx context.Context, body model.EventHandler) (*http.Response, error) -``` - -EventResourceApiService Update an existing event handler. - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -## type [GenericSwaggerError]() - -GenericSwaggerError Provides access to the body, error and model on returned errors. - -```go -type GenericSwaggerError struct { - // contains filtered or unexported fields -} -``` - - -### func \(GenericSwaggerError\) [Body]() - -```go -func (e GenericSwaggerError) Body() []byte -``` - -Body returns the raw bytes of the response - - -### func \(GenericSwaggerError\) [Error]() - -```go -func (e GenericSwaggerError) Error() string -``` - -Error returns non\-empty string if there was an error. - - -### func \(GenericSwaggerError\) [Model]() - -```go -func (e GenericSwaggerError) Model() interface{} -``` - -Model returns the unpacked model of the error - - -## type [GetAllSchedulesOpts]() - - - -```go -type GetAllSchedulesOpts struct { - WorkflowName optional.String -} -``` - - -## type [HealthCheckResourceApiService]() - - - -```go -type HealthCheckResourceApiService struct { - *APIClient -} -``` - - -### func \(\*HealthCheckResourceApiService\) [DoCheck]() - -```go -func (a *HealthCheckResourceApiService) DoCheck(ctx context.Context) (model.HealthCheckStatus, *http.Response, error) -``` - -HealthCheckResourceApiService - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return http\_model.HealthCheckStatus - - -## type [HttpRequester]() - - - -```go -type HttpRequester struct { - // contains filtered or unexported fields -} -``` - - -### func [NewHttpRequester]() - -```go -func NewHttpRequester(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings, httpClient *http.Client, tokenExpiration *authentication.TokenExpiration) *HttpRequester -``` - - - - -## type [MetadataResourceApiGetOpts]() - - - -```go -type MetadataResourceApiGetOpts struct { - Version optional.Int32 -} -``` - - -## type [MetadataResourceApiService]() - - - -```go -type MetadataResourceApiService struct { - *APIClient -} -``` - - -### func \(\*MetadataResourceApiService\) [Get]() - -```go -func (a *MetadataResourceApiService) Get(ctx context.Context, name string, localVarOptionals *MetadataResourceApiGetOpts) (model.WorkflowDef, *http.Response, error) -``` - - - - -### func \(\*MetadataResourceApiService\) [GetAll]() - -```go -func (a *MetadataResourceApiService) GetAll(ctx context.Context) ([]model.WorkflowDef, *http.Response, error) -``` - -MetadataResourceApiService Retrieves all workflow definition along with blueprint - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return \[\]http\_model.WorkflowDef - - -### func \(\*MetadataResourceApiService\) [GetTagsForTaskDef]() - -```go -func (a *MetadataResourceApiService) GetTagsForTaskDef(ctx context.Context, tasktype string) ([]model.MetadataTag, error) -``` - - - - -### func \(\*MetadataResourceApiService\) [GetTagsForWorkflowDef]() - -```go -func (a *MetadataResourceApiService) GetTagsForWorkflowDef(ctx context.Context, name string) ([]model.MetadataTag, error) -``` - - - - -### func \(\*MetadataResourceApiService\) [GetTaskDef]() - -```go -func (a *MetadataResourceApiService) GetTaskDef(ctx context.Context, tasktype string) (model.TaskDef, *http.Response, error) -``` - -MetadataResourceApiService Gets the task definition - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param tasktype - -@return http\_model.TaskDef - - -### func \(\*MetadataResourceApiService\) [GetTaskDefs]() - -```go -func (a *MetadataResourceApiService) GetTaskDefs(ctx context.Context) ([]model.TaskDef, *http.Response, error) -``` - -MetadataResourceApiService Gets all task definition - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return \[\]http\_model.TaskDef - - -### func \(\*MetadataResourceApiService\) [RegisterTaskDef]() - -```go -func (a *MetadataResourceApiService) RegisterTaskDef(ctx context.Context, body []model.TaskDef) (*http.Response, error) -``` - -MetadataResourceApiService Create new task definition\(s\) - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [RegisterTaskDefWithTags]() - -```go -func (a *MetadataResourceApiService) RegisterTaskDefWithTags(ctx context.Context, body model.TaskDef, tags []model.MetadataTag) (*http.Response, error) -``` - -MetadataResourceApiService Create new task definition with tags - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body model.TaskDef -- @param tags \[\]model.MetadataTag - - -### func \(\*MetadataResourceApiService\) [RegisterWorkflowDef]() - -```go -func (a *MetadataResourceApiService) RegisterWorkflowDef(ctx context.Context, overwrite bool, body model.WorkflowDef) (*http.Response, error) -``` - -MetadataResourceApiService Create a new workflow definition - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [RegisterWorkflowDefWithTags]() - -```go -func (a *MetadataResourceApiService) RegisterWorkflowDefWithTags(ctx context.Context, overwrite bool, body model.WorkflowDef, tags []model.MetadataTag) (*http.Response, error) -``` - -MetadataResourceApiService Create a new workflow definition with tags - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [UnregisterTaskDef]() - -```go -func (a *MetadataResourceApiService) UnregisterTaskDef(ctx context.Context, tasktype string) (*http.Response, error) -``` - -MetadataResourceApiService Remove a task definition - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param tasktype - - -### func \(\*MetadataResourceApiService\) [UnregisterWorkflowDef]() - -```go -func (a *MetadataResourceApiService) UnregisterWorkflowDef(ctx context.Context, name string, version int32) (*http.Response, error) -``` - -MetadataResourceApiService Removes workflow definition. It does not remove workflows associated with the definition. - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name -- @param version - - -### func \(\*MetadataResourceApiService\) [Update]() - -```go -func (a *MetadataResourceApiService) Update(ctx context.Context, body []model.WorkflowDef) (*http.Response, error) -``` - -MetadataResourceApiService Create or update workflow definition - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [UpdateTaskDef]() - -```go -func (a *MetadataResourceApiService) UpdateTaskDef(ctx context.Context, body model.TaskDef) (*http.Response, error) -``` - -MetadataResourceApiService Update an existing task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [UpdateTaskDefWithTags]() - -```go -func (a *MetadataResourceApiService) UpdateTaskDefWithTags(ctx context.Context, body model.TaskDef, tags []model.MetadataTag, overwriteTags bool) (*http.Response, error) -``` - -MetadataResourceApiService Update an existing task along with tags - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*MetadataResourceApiService\) [UpdateWorkflowDefWithTags]() - -```go -func (a *MetadataResourceApiService) UpdateWorkflowDefWithTags(ctx context.Context, body model.WorkflowDef, tags []model.MetadataTag, overwriteTags bool) (*http.Response, error) -``` - -MetadataResourceApiService Create or update workflow definition along with tags - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -## type [NextFewSchedulesOpts]() - - - -```go -type NextFewSchedulesOpts struct { - ScheduleStartTime optional.Int64 - ScheduleEndTime optional.Int64 - Limit optional.Int32 -} -``` - - -## type [SchedulerClient]() - -SchedulerClient manage workflow schedules - -```go -type SchedulerClient interface { - // DeleteSchedule Deletes the schedule given the name - DeleteSchedule(ctx context.Context, name string) (*http.Response, error) - - //DeleteTagForSchedule Remove the tags from the schedule - DeleteTagForSchedule(ctx context.Context, tags []model.Tag, name string) (*http.Response, error) - - //GetAllSchedules Retrieve all the schedules - GetAllSchedules(ctx context.Context, localVarOptionals *GetAllSchedulesOpts) ([]model.WorkflowSchedule, *http.Response, error) - - //GetNextFewSchedules given the cron expression retrieves the next few schedules. Useful for testing - GetNextFewSchedules(ctx context.Context, cronExpression string, localVarOptionals *NextFewSchedulesOpts) ([]int64, *http.Response, error) - - //GetSchedule Retrieve schedule definition given the name - GetSchedule(ctx context.Context, name string) (model.WorkflowSchedule, *http.Response, error) - - //GetTagsForSchedule get tags associated with the schedule - GetTagsForSchedule(ctx context.Context, name string) ([]model.Tag, *http.Response, error) - - //PauseAllSchedules WARNING: pauses ALL the schedules in the system. Use with caution! - PauseAllSchedules(ctx context.Context) (map[string]interface{}, *http.Response, error) - - //PauseSchedule pause the schedule by name - PauseSchedule(ctx context.Context, name string) (*http.Response, error) - - //AddTagForSchedule Adds tags to the schedule - AddTagForSchedule(ctx context.Context, tags []model.Tag, name string) (*http.Response, error) - - //ResumeAllSchedules Resume ALL the schedule. WARNING: use with caution! - ResumeAllSchedules(ctx context.Context) (map[string]interface{}, *http.Response, error) - - //ResumeSchedule Resumes the schedule by name - ResumeSchedule(ctx context.Context, name string) (*http.Response, error) - - //SaveSchedule Upsert a new schedule - SaveSchedule(ctx context.Context, body model.SaveScheduleRequest) (*http.Response, error) - - //Search Find all the executions for the given schedule - Search(ctx context.Context, localVarOptionals *SchedulerSearchOpts) (model.SearchResultWorkflowSchedule, *http.Response, error) -} -``` - - -### func [GetSchedulerService]() - -```go -func GetSchedulerService(client *APIClient) SchedulerClient -``` - - - - -## type [SchedulerResourceApiService]() - - - -```go -type SchedulerResourceApiService struct { - *APIClient -} -``` - - -### func \(\*SchedulerResourceApiService\) [AddTagForSchedule]() - -```go -func (a *SchedulerResourceApiService) AddTagForSchedule(ctx context.Context, body []model.Tag, name string) (*http.Response, error) -``` - - - - -### func \(\*SchedulerResourceApiService\) [DeleteSchedule]() - -```go -func (a *SchedulerResourceApiService) DeleteSchedule(ctx context.Context, name string) (*http.Response, error) -``` - - - - -### func \(\*SchedulerResourceApiService\) [DeleteTagForSchedule]() - -```go -func (a *SchedulerResourceApiService) DeleteTagForSchedule(ctx context.Context, tags []model.Tag, name string) (*http.Response, error) -``` - - - - -### func \(\*SchedulerResourceApiService\) [GetAllSchedules]() - -```go -func (a *SchedulerResourceApiService) GetAllSchedules(ctx context.Context, localVarOptionals *GetAllSchedulesOpts) ([]model.WorkflowSchedule, *http.Response, error) -``` - - - - -### func \(\*SchedulerResourceApiService\) [GetNextFewSchedules]() - -```go -func (a *SchedulerResourceApiService) GetNextFewSchedules(ctx context.Context, cronExpression string, localVarOptionals *NextFewSchedulesOpts) ([]int64, *http.Response, error) -``` - - - - -### func \(\*SchedulerResourceApiService\) [GetSchedule]() - -```go -func (a *SchedulerResourceApiService) GetSchedule(ctx context.Context, name string) (model.WorkflowSchedule, *http.Response, error) -``` - -SchedulerResourceApiService Get an existing workflow schedule by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - -@return WorkflowSchedule - - -### func \(\*SchedulerResourceApiService\) [GetTagsForSchedule]() - -```go -func (a *SchedulerResourceApiService) GetTagsForSchedule(ctx context.Context, name string) ([]model.Tag, *http.Response, error) -``` - -SchedulerResourceApiService Get tags by schedule - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - -@return \[\]TagObject - - -### func \(\*SchedulerResourceApiService\) [PauseAllSchedules]() - -```go -func (a *SchedulerResourceApiService) PauseAllSchedules(ctx context.Context) (map[string]interface{}, *http.Response, error) -``` - -SchedulerResourceApiService Pause all scheduling in a single conductor server instance \(for debugging only\) - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return map\[string\]interface\{\} - - -### func \(\*SchedulerResourceApiService\) [PauseSchedule]() - -```go -func (a *SchedulerResourceApiService) PauseSchedule(ctx context.Context, name string) (*http.Response, error) -``` - -SchedulerResourceApiService Pauses an existing schedule by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - - -### func \(\*SchedulerResourceApiService\) [ResumeAllSchedules]() - -```go -func (a *SchedulerResourceApiService) ResumeAllSchedules(ctx context.Context) (map[string]interface{}, *http.Response, error) -``` - -SchedulerResourceApiService Resume all scheduling - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return map\[string\]interface\{\} - - -### func \(\*SchedulerResourceApiService\) [ResumeSchedule]() - -```go -func (a *SchedulerResourceApiService) ResumeSchedule(ctx context.Context, name string) (*http.Response, error) -``` - -SchedulerResourceApiService Resume a paused schedule by name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - - -### func \(\*SchedulerResourceApiService\) [SaveSchedule]() - -```go -func (a *SchedulerResourceApiService) SaveSchedule(ctx context.Context, body model.SaveScheduleRequest) (*http.Response, error) -``` - -SchedulerResourceApiService Create or update a schedule for a specified workflow with a corresponding start workflow request - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - - -### func \(\*SchedulerResourceApiService\) [Search]() - -```go -func (a *SchedulerResourceApiService) Search(ctx context.Context, localVarOptionals *SchedulerSearchOpts) (model.SearchResultWorkflowSchedule, *http.Response, error) -``` - - - - -## type [SchedulerSearchOpts]() - - - -```go -type SchedulerSearchOpts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [TagsApiService]() - - - -```go -type TagsApiService struct { - *APIClient -} -``` - - -### func \(\*TagsApiService\) [AddTaskTag]() - -```go -func (a *TagsApiService) AddTaskTag(ctx context.Context, body model.TagObject, taskName string) (interface{}, *http.Response, error) -``` - -TagsApiService Adds the tag to the task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param taskName - -@return interface\{\} - - -### func \(\*TagsApiService\) [AddWorkflowTag]() - -```go -func (a *TagsApiService) AddWorkflowTag(ctx context.Context, body model.TagObject, name string) (interface{}, *http.Response, error) -``` - -TagsApiService Adds the tag to the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param name - -@return interface\{\} - - -### func \(\*TagsApiService\) [DeleteTaskTag]() - -```go -func (a *TagsApiService) DeleteTaskTag(ctx context.Context, body model.TagString, taskName string) (interface{}, *http.Response, error) -``` - -TagsApiService Removes the tag of the task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param taskName - -@return interface\{\} - - -### func \(\*TagsApiService\) [DeleteWorkflowTag]() - -```go -func (a *TagsApiService) DeleteWorkflowTag(ctx context.Context, body model.TagObject, name string) (interface{}, *http.Response, error) -``` - -TagsApiService Removes the tag of the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param name - -@return interface\{\} - - -### func \(\*TagsApiService\) [GetTags1]() - -```go -func (a *TagsApiService) GetTags1(ctx context.Context) ([]model.TagObject, *http.Response, error) -``` - -TagsApiService List all tags - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return \[\]model.TagObject - - -### func \(\*TagsApiService\) [GetTaskTags]() - -```go -func (a *TagsApiService) GetTaskTags(ctx context.Context, taskName string) ([]model.TagObject, *http.Response, error) -``` - -TagsApiService Returns all the tags of the task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param taskName - -@return \[\]model.TagObject - - -### func \(\*TagsApiService\) [GetWorkflowTags]() - -```go -func (a *TagsApiService) GetWorkflowTags(ctx context.Context, name string) ([]model.TagObject, *http.Response, error) -``` - -TagsApiService Returns all the tags of the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param name - -@return \[\]model.TagObject - - -### func \(\*TagsApiService\) [SetTaskTags]() - -```go -func (a *TagsApiService) SetTaskTags(ctx context.Context, body []model.TagObject, taskName string) (interface{}, *http.Response, error) -``` - -TagsApiService Adds the tag to the task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param taskName - -@return interface\{\} - - -### func \(\*TagsApiService\) [SetWorkflowTags]() - -```go -func (a *TagsApiService) SetWorkflowTags(ctx context.Context, body []model.TagObject, name string) (interface{}, *http.Response, error) -``` - -TagsApiService Set the tags of the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param name - -@return interface\{\} - - -## type [TaskResourceApiBatchPollOpts]() - - - -```go -type TaskResourceApiBatchPollOpts struct { - Workerid optional.String - Domain optional.String - Count optional.Int32 - Timeout optional.Int32 -} -``` - - -## type [TaskResourceApiPollOpts]() - - - -```go -type TaskResourceApiPollOpts struct { - Workerid optional.String - Domain optional.String -} -``` - - -## type [TaskResourceApiSearch1Opts]() - - - -```go -type TaskResourceApiSearch1Opts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [TaskResourceApiSearchV21Opts]() - - - -```go -type TaskResourceApiSearchV21Opts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [TaskResourceApiService]() - - - -```go -type TaskResourceApiService struct { - *APIClient -} -``` - - -### func \(\*TaskResourceApiService\) [All]() - -```go -func (a *TaskResourceApiService) All(ctx context.Context) (map[string]int64, *http.Response, error) -``` - -TaskResourceApiService Get the details about each queue - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return map\[string\]int64 - - -### func \(\*TaskResourceApiService\) [AllVerbose]() - -```go -func (a *TaskResourceApiService) AllVerbose(ctx context.Context) (map[string]map[string]map[string]int64, *http.Response, error) -``` - -TaskResourceApiService Get the details about each queue - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return map\[string\]map\[string\]map\[string\]int64 - - -### func \(\*TaskResourceApiService\) [BatchPoll]() - -```go -func (a *TaskResourceApiService) BatchPoll(ctx context.Context, tasktype string, localVarOptionals *TaskResourceApiBatchPollOpts) ([]model.Task, *http.Response, error) -``` - - - - -### func \(\*TaskResourceApiService\) [GetAllPollData]() - -```go -func (a *TaskResourceApiService) GetAllPollData(ctx context.Context) ([]model.PollData, *http.Response, error) -``` - -TaskResourceApiService Get the last poll data for all task types - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). - -@return \[\]PollData - - -### func \(\*TaskResourceApiService\) [GetExternalStorageLocation1]() - -```go -func (a *TaskResourceApiService) GetExternalStorageLocation1(ctx context.Context, path string, operation string, payloadType string) (model.ExternalStorageLocation, *http.Response, error) -``` - -TaskResourceApiService Get the external uri where the task payload is to be stored - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param path -- @param operation -- @param payloadType - -@return ExternalStorageLocation - - -### func \(\*TaskResourceApiService\) [GetPollData]() - -```go -func (a *TaskResourceApiService) GetPollData(ctx context.Context, taskType string) ([]model.PollData, *http.Response, error) -``` - -TaskResourceApiService Get the last poll data for a given task type - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param taskType - -@return \[\]PollData - - -### func \(\*TaskResourceApiService\) [GetTask]() - -```go -func (a *TaskResourceApiService) GetTask(ctx context.Context, taskId string) (model.Task, *http.Response, error) -``` - -TaskResourceApiService Get task by Id - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param taskId - -@return Task - - -### func \(\*TaskResourceApiService\) [GetTaskLogs]() - -```go -func (a *TaskResourceApiService) GetTaskLogs(ctx context.Context, taskId string) ([]model.TaskExecLog, *http.Response, error) -``` - -TaskResourceApiService Get Task Execution Logs - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param taskId - -@return \[\]TaskExecLog - - -### func \(\*TaskResourceApiService\) [Log]() - -```go -func (a *TaskResourceApiService) Log(ctx context.Context, body string, taskId string) (*http.Response, error) -``` - -TaskResourceApiService Log Task Execution Details - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param taskId - - -### func \(\*TaskResourceApiService\) [Poll]() - -```go -func (a *TaskResourceApiService) Poll(ctx context.Context, tasktype string, localVarOptionals *TaskResourceApiPollOpts) (model.Task, *http.Response, error) -``` - - - - -### func \(\*TaskResourceApiService\) [RequeuePendingTask]() - -```go -func (a *TaskResourceApiService) RequeuePendingTask(ctx context.Context, taskType string) (string, *http.Response, error) -``` - -TaskResourceApiService Requeue pending tasks - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param taskType - -@return string - - -### func \(\*TaskResourceApiService\) [Search1]() - -```go -func (a *TaskResourceApiService) Search1(ctx context.Context, localVarOptionals *TaskResourceApiSearch1Opts) (model.SearchResultTaskSummary, *http.Response, error) -``` - - - - -### func \(\*TaskResourceApiService\) [SearchV21]() - -```go -func (a *TaskResourceApiService) SearchV21(ctx context.Context, localVarOptionals *TaskResourceApiSearchV21Opts) (model.SearchResultTask, *http.Response, error) -``` - - - - -### func \(\*TaskResourceApiService\) [Size]() - -```go -func (a *TaskResourceApiService) Size(ctx context.Context, localVarOptionals *TaskResourceApiSizeOpts) (map[string]int32, *http.Response, error) -``` - - - - -### func \(\*TaskResourceApiService\) [UpdateTask]() - -```go -func (a *TaskResourceApiService) UpdateTask(ctx context.Context, taskResult *model.TaskResult) (string, *http.Response, error) -``` - -TaskResourceApiService Update a task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - -@return string - - -### func \(\*TaskResourceApiService\) [UpdateTaskByRefName]() - -```go -func (a *TaskResourceApiService) UpdateTaskByRefName(ctx context.Context, body map[string]interface{}, workflowId string, taskRefName string, status string) (string, *http.Response, error) -``` - -TaskResourceApiService Update a task By Ref Name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param workflowId -- @param taskRefName -- @param status - -@return string - - -### func \(\*TaskResourceApiService\) [UpdateTaskByRefNameWithWorkerId]() - -```go -func (a *TaskResourceApiService) UpdateTaskByRefNameWithWorkerId(ctx context.Context, body map[string]interface{}, workflowId string, taskRefName string, status string, workerId optional.String) (string, *http.Response, error) -``` - -TaskResourceApiService Update a task By Ref Name - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param workflowId -- @param taskRefName -- @param status -- @param workerId - -@return string - - -## type [TaskResourceApiSizeOpts]() - - - -```go -type TaskResourceApiSizeOpts struct { - TaskType optional.Interface -} -``` - - -## type [WorkflowBulkResourceApiRestart1Opts]() - - - -```go -type WorkflowBulkResourceApiRestart1Opts struct { - UseLatestDefinitions optional.Bool -} -``` - - -## type [WorkflowBulkResourceApiService]() - - - -```go -type WorkflowBulkResourceApiService struct { - *APIClient -} -``` - - -### func \(\*WorkflowBulkResourceApiService\) [PauseWorkflow1]() - -```go -func (a *WorkflowBulkResourceApiService) PauseWorkflow1(ctx context.Context, body []string) (model.BulkResponse, *http.Response, error) -``` - -WorkflowBulkResourceApiService Pause the list of workflows - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - -@return http\_model.BulkResponse - - -### func \(\*WorkflowBulkResourceApiService\) [Restart1]() - -```go -func (a *WorkflowBulkResourceApiService) Restart1(ctx context.Context, body []string, localVarOptionals *WorkflowBulkResourceApiRestart1Opts) (model.BulkResponse, *http.Response, error) -``` - - - - -### func \(\*WorkflowBulkResourceApiService\) [ResumeWorkflow1]() - -```go -func (a *WorkflowBulkResourceApiService) ResumeWorkflow1(ctx context.Context, body []string) (model.BulkResponse, *http.Response, error) -``` - -WorkflowBulkResourceApiService Resume the list of workflows - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - -@return http\_model.BulkResponse - - -### func \(\*WorkflowBulkResourceApiService\) [Retry1]() - -```go -func (a *WorkflowBulkResourceApiService) Retry1(ctx context.Context, body []string) (model.BulkResponse, *http.Response, error) -``` - -WorkflowBulkResourceApiService Retry the last failed task for each workflow from the list - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - -@return http\_model.BulkResponse - - -### func \(\*WorkflowBulkResourceApiService\) [Terminate]() - -```go -func (a *WorkflowBulkResourceApiService) Terminate(ctx context.Context, body []string, localVarOptionals *WorkflowBulkResourceApiTerminateOpts) (model.BulkResponse, *http.Response, error) -``` - - - - -## type [WorkflowBulkResourceApiTerminateOpts]() - - - -```go -type WorkflowBulkResourceApiTerminateOpts struct { - Reason optional.String - TriggerFailureWorkflow optional.Bool -} -``` - - -## type [WorkflowResourceApiDeleteOpts]() - - - -```go -type WorkflowResourceApiDeleteOpts struct { - ArchiveWorkflow optional.Bool -} -``` - - -## type [WorkflowResourceApiGetExecutionStatusOpts]() - - - -```go -type WorkflowResourceApiGetExecutionStatusOpts struct { - IncludeTasks optional.Bool -} -``` - - -## type [WorkflowResourceApiGetRunningWorkflowOpts]() - - - -```go -type WorkflowResourceApiGetRunningWorkflowOpts struct { - Version optional.Int32 - StartTime optional.Int64 - EndTime optional.Int64 -} -``` - - -## type [WorkflowResourceApiGetWorkflows1Opts]() - - - -```go -type WorkflowResourceApiGetWorkflows1Opts struct { - IncludeClosed optional.Bool - IncludeTasks optional.Bool -} -``` - - -## type [WorkflowResourceApiGetWorkflowsOpts]() - - - -```go -type WorkflowResourceApiGetWorkflowsOpts struct { - IncludeClosed optional.Bool - IncludeTasks optional.Bool -} -``` - - -## type [WorkflowResourceApiRestartOpts]() - - - -```go -type WorkflowResourceApiRestartOpts struct { - UseLatestDefinitions optional.Bool -} -``` - - -## type [WorkflowResourceApiRetryOpts]() - - - -```go -type WorkflowResourceApiRetryOpts struct { - ResumeSubworkflowTasks optional.Bool -} -``` - - -## type [WorkflowResourceApiSearchOpts]() - - - -```go -type WorkflowResourceApiSearchOpts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [WorkflowResourceApiSearchV2Opts]() - - - -```go -type WorkflowResourceApiSearchV2Opts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [WorkflowResourceApiSearchWorkflowsByTasksOpts]() - - - -```go -type WorkflowResourceApiSearchWorkflowsByTasksOpts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [WorkflowResourceApiSearchWorkflowsByTasksV2Opts]() - - - -```go -type WorkflowResourceApiSearchWorkflowsByTasksV2Opts struct { - Start optional.Int32 - Size optional.Int32 - Sort optional.String - FreeText optional.String - Query optional.String -} -``` - - -## type [WorkflowResourceApiService]() - - - -```go -type WorkflowResourceApiService struct { - *APIClient -} -``` - - -### func \(\*WorkflowResourceApiService\) [Decide]() - -```go -func (a *WorkflowResourceApiService) Decide(ctx context.Context, workflowId string) (*http.Response, error) -``` - -WorkflowResourceApiService Starts the decision task for a workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param workflowId - - -### func \(\*WorkflowResourceApiService\) [Delete]() - -```go -func (a *WorkflowResourceApiService) Delete(ctx context.Context, workflowId string, localVarOptionals *WorkflowResourceApiDeleteOpts) (*http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [ExecuteWorkflow]() - -```go -func (a *WorkflowResourceApiService) ExecuteWorkflow(ctx context.Context, body model.StartWorkflowRequest, requestId string, name string, version int32, waitUntilTask string) (model.WorkflowRun, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetExecutionStatus]() - -```go -func (a *WorkflowResourceApiService) GetExecutionStatus(ctx context.Context, workflowId string, localVarOptionals *WorkflowResourceApiGetExecutionStatusOpts) (model.Workflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetExternalStorageLocation]() - -```go -func (a *WorkflowResourceApiService) GetExternalStorageLocation(ctx context.Context, path string, operation string, payloadType string) (model.ExternalStorageLocation, *http.Response, error) -``` - -WorkflowResourceApiService Get the uri and path of the external storage where the workflow payload is to be stored - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param path -- @param operation -- @param payloadType - -@return http\_model.ExternalStorageLocation - - -### func \(\*WorkflowResourceApiService\) [GetRunningWorkflow]() - -```go -func (a *WorkflowResourceApiService) GetRunningWorkflow(ctx context.Context, name string, localVarOptionals *WorkflowResourceApiGetRunningWorkflowOpts) ([]string, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetWorkflowState]() - -```go -func (a *WorkflowResourceApiService) GetWorkflowState(ctx context.Context, workflowId string, includeOutput bool, includeVariables bool) (model.WorkflowState, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetWorkflows]() - -```go -func (a *WorkflowResourceApiService) GetWorkflows(ctx context.Context, body []string, name string, localVarOptionals *WorkflowResourceApiGetWorkflowsOpts) (map[string][]model.Workflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetWorkflows1]() - -```go -func (a *WorkflowResourceApiService) GetWorkflows1(ctx context.Context, name string, correlationId string, localVarOptionals *WorkflowResourceApiGetWorkflows1Opts) ([]model.Workflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [GetWorkflowsBatch]() - -```go -func (a *WorkflowResourceApiService) GetWorkflowsBatch(ctx context.Context, body map[string][]string, localVarOptionals *WorkflowResourceApiGetWorkflowsOpts) (map[string][]model.Workflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [PauseWorkflow]() - -```go -func (a *WorkflowResourceApiService) PauseWorkflow(ctx context.Context, workflowId string) (*http.Response, error) -``` - -WorkflowResourceApiService Pauses the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param workflowId - - -### func \(\*WorkflowResourceApiService\) [Rerun]() - -```go -func (a *WorkflowResourceApiService) Rerun(ctx context.Context, body model.RerunWorkflowRequest, workflowId string) (string, *http.Response, error) -``` - -WorkflowResourceApiService Reruns the workflow from a specific task - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body -- @param workflowId - -@return string - - -### func \(\*WorkflowResourceApiService\) [ResetWorkflow]() - -```go -func (a *WorkflowResourceApiService) ResetWorkflow(ctx context.Context, workflowId string) (*http.Response, error) -``` - -WorkflowResourceApiService Resets callback times of all non\-terminal SIMPLE tasks to 0 - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param workflowId - - -### func \(\*WorkflowResourceApiService\) [Restart]() - -```go -func (a *WorkflowResourceApiService) Restart(ctx context.Context, workflowId string, localVarOptionals *WorkflowResourceApiRestartOpts) (*http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [ResumeWorkflow]() - -```go -func (a *WorkflowResourceApiService) ResumeWorkflow(ctx context.Context, workflowId string) (*http.Response, error) -``` - -WorkflowResourceApiService Resumes the workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param workflowId - - -### func \(\*WorkflowResourceApiService\) [Retry]() - -```go -func (a *WorkflowResourceApiService) Retry(ctx context.Context, workflowId string, localVarOptionals *WorkflowResourceApiRetryOpts) (*http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [Search]() - -```go -func (a *WorkflowResourceApiService) Search(ctx context.Context, localVarOptionals *WorkflowResourceApiSearchOpts) (model.SearchResultWorkflowSummary, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [SearchV2]() - -```go -func (a *WorkflowResourceApiService) SearchV2(ctx context.Context, localVarOptionals *WorkflowResourceApiSearchV2Opts) (model.SearchResultWorkflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [SearchWorkflowsByTasks]() - -```go -func (a *WorkflowResourceApiService) SearchWorkflowsByTasks(ctx context.Context, localVarOptionals *WorkflowResourceApiSearchWorkflowsByTasksOpts) (model.SearchResultWorkflowSummary, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [SearchWorkflowsByTasksV2]() - -```go -func (a *WorkflowResourceApiService) SearchWorkflowsByTasksV2(ctx context.Context, localVarOptionals *WorkflowResourceApiSearchWorkflowsByTasksV2Opts) (model.SearchResultWorkflow, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [SkipTaskFromWorkflow]() - -```go -func (a *WorkflowResourceApiService) SkipTaskFromWorkflow(ctx context.Context, workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest) (*http.Response, error) -``` - -WorkflowResourceApiService Skips a given task from a current running workflow - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param workflowId -- @param taskReferenceName -- @param skipTaskRequest - - -### func \(\*WorkflowResourceApiService\) [StartWorkflow]() - -```go -func (a *WorkflowResourceApiService) StartWorkflow(ctx context.Context, body map[string]interface{}, name string, localVarOptionals *WorkflowResourceApiStartWorkflowOpts) (string, *http.Response, error) -``` - - - - -### func \(\*WorkflowResourceApiService\) [StartWorkflowWithRequest]() - -```go -func (a *WorkflowResourceApiService) StartWorkflowWithRequest(ctx context.Context, body model.StartWorkflowRequest) (string, *http.Response, error) -``` - -WorkflowResourceApiService Start a new workflow with http\_model.StartWorkflowRequest, which allows task to be executed in a domain - -- @param ctx context.Context \- for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background\(\). -- @param body - -@return string - - -### func \(\*WorkflowResourceApiService\) [Terminate]() - -```go -func (a *WorkflowResourceApiService) Terminate(ctx context.Context, workflowId string, localVarOptionals *WorkflowResourceApiTerminateOpts) (*http.Response, error) -``` - - - - -## type [WorkflowResourceApiStartWorkflowOpts]() - - - -```go -type WorkflowResourceApiStartWorkflowOpts struct { - Version optional.Int32 - CorrelationId optional.String - Priority optional.Int32 -} -``` - - -## type [WorkflowResourceApiTerminateOpts]() - - - -```go -type WorkflowResourceApiTerminateOpts struct { - Reason optional.String - TriggerFailureWorkflow optional.Bool -} -``` - -Generated by [gomarkdoc]() diff --git a/docs/executor.md b/docs/executor.md deleted file mode 100644 index 11151b02..00000000 --- a/docs/executor.md +++ /dev/null @@ -1,323 +0,0 @@ - - -# executor - -```go -import "github.com/conductor-sdk/conductor-go/sdk/workflow/executor" -``` - -## Index - -- [func WaitForWorkflowCompletionUntilTimeout(executionChannel WorkflowExecutionChannel, timeout time.Duration) (workflow *model.Workflow, err error)](<#func-waitforworkflowcompletionuntiltimeout>) -- [type RunningWorkflow](<#type-runningworkflow>) - - [func NewRunningWorkflow(workflowId string, workflowExecutionChannel WorkflowExecutionChannel, err error) *RunningWorkflow](<#func-newrunningworkflow>) - - [func (rw *RunningWorkflow) WaitForCompletionUntilTimeout(timeout time.Duration) (workflow *model.Workflow, err error)](<#func-runningworkflow-waitforcompletionuntiltimeout>) -- [type WorkflowExecutionChannel](<#type-workflowexecutionchannel>) -- [type WorkflowExecutor](<#type-workflowexecutor>) - - [func NewWorkflowExecutor(apiClient *client.APIClient) *WorkflowExecutor](<#func-newworkflowexecutor>) - - [func (e *WorkflowExecutor) DeleteQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)](<#func-workflowexecutor-deletequeueconfiguration>) - - [func (e *WorkflowExecutor) ExecuteWorkflow(startWorkflowRequest *model.StartWorkflowRequest, waitUntilTask string) (run *model.WorkflowRun, err error)](<#func-workflowexecutor-executeworkflow>) - - [func (e *WorkflowExecutor) GetByCorrelationIds(workflowName string, includeClosed bool, includeTasks bool, correlationIds ...string) (map[string][]model.Workflow, error)](<#func-workflowexecutor-getbycorrelationids>) - - [func (e *WorkflowExecutor) GetQueueConfiguration(queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)](<#func-workflowexecutor-getqueueconfiguration>) - - [func (e *WorkflowExecutor) GetTask(taskId string) (task *model.Task, err error)](<#func-workflowexecutor-gettask>) - - [func (e *WorkflowExecutor) GetWorkflow(workflowId string, includeTasks bool) (*model.Workflow, error)](<#func-workflowexecutor-getworkflow>) - - [func (e *WorkflowExecutor) GetWorkflowStatus(workflowId string, includeOutput bool, includeVariables bool) (*model.WorkflowState, error)](<#func-workflowexecutor-getworkflowstatus>) - - [func (e *WorkflowExecutor) MonitorExecution(workflowId string) (workflowMonitor WorkflowExecutionChannel, err error)](<#func-workflowexecutor-monitorexecution>) - - [func (e *WorkflowExecutor) Pause(workflowId string) error](<#func-workflowexecutor-pause>) - - [func (e *WorkflowExecutor) PutQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)](<#func-workflowexecutor-putqueueconfiguration>) - - [func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)](<#func-workflowexecutor-rerun>) - - [func (e *WorkflowExecutor) RegisterWorkflow(overwrite bool, workflow *model.WorkflowDef) error](<#func-workflowexecutor-registerworkflow>) - - [func (e *WorkflowExecutor) RemoveWorkflow(workflowId string) error](<#func-workflowexecutor-removeworkflow>) - - [func (e *WorkflowExecutor) Restart(workflowId string, useLatestDefinition bool) error](<#func-workflowexecutor-restart>) - - [func (e *WorkflowExecutor) Resume(workflowId string) error](<#func-workflowexecutor-resume>) - - [func (e *WorkflowExecutor) Retry(workflowId string, resumeSubworkflowTasks bool) error](<#func-workflowexecutor-retry>) - - [func (e *WorkflowExecutor) Search(start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error)](<#func-workflowexecutor-search>) - - [func (e *WorkflowExecutor) SkipTasksFromWorkflow(workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest) error](<#func-workflowexecutor-skiptasksfromworkflow>) - - [func (e *WorkflowExecutor) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)](<#func-workflowexecutor-startworkflow>) - - [func (e *WorkflowExecutor) StartWorkflows(monitorExecution bool, startWorkflowRequests ...*model.StartWorkflowRequest) []*RunningWorkflow](<#func-workflowexecutor-startworkflows>) - - [func (e *WorkflowExecutor) Terminate(workflowId string, reason string) error](<#func-workflowexecutor-terminate>) - - [func (e *WorkflowExecutor) UpdateTask(taskId string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error](<#func-workflowexecutor-updatetask>) - - [func (e *WorkflowExecutor) UpdateTaskByRefName(taskRefName string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error](<#func-workflowexecutor-updatetaskbyrefname>) - - [func (e *WorkflowExecutor) WaitForRunningWorkflowsUntilTimeout(timeout time.Duration, runningWorkflows ...*RunningWorkflow)](<#func-workflowexecutor-waitforrunningworkflowsuntiltimeout>) -- [type WorkflowMonitor](<#type-workflowmonitor>) - - [func NewWorkflowMonitor(workflowClient *client.WorkflowResourceApiService) *WorkflowMonitor](<#func-newworkflowmonitor>) - - -## func [WaitForWorkflowCompletionUntilTimeout]() - -```go -func WaitForWorkflowCompletionUntilTimeout(executionChannel WorkflowExecutionChannel, timeout time.Duration) (workflow *model.Workflow, err error) -``` - -WaitForWorkflowCompletionUntilTimeout Helper method to wait on the channel until the timeout for the workflow execution to complete - -## type [RunningWorkflow]() - -```go -type RunningWorkflow struct { - WorkflowId string - WorkflowExecutionChannel WorkflowExecutionChannel - Err error - CompletedWorkflow *model.Workflow -} -``` - -### func [NewRunningWorkflow]() - -```go -func NewRunningWorkflow(workflowId string, workflowExecutionChannel WorkflowExecutionChannel, err error) *RunningWorkflow -``` - -### func \(\*RunningWorkflow\) [WaitForCompletionUntilTimeout]() - -```go -func (rw *RunningWorkflow) WaitForCompletionUntilTimeout(timeout time.Duration) (workflow *model.Workflow, err error) -``` - -## type [WorkflowExecutionChannel]() - -```go -type WorkflowExecutionChannel chan *model.Workflow -``` - -## type [WorkflowExecutor]() - -```go -type WorkflowExecutor struct { - // contains filtered or unexported fields -} -``` - -### func [NewWorkflowExecutor]() - -```go -func NewWorkflowExecutor(apiClient *client.APIClient) *WorkflowExecutor -``` - -NewWorkflowExecutor Create a new workflow executor - -### func \(\*WorkflowExecutor\) [DeleteQueueConfiguration]() - -```go -func (e *WorkflowExecutor) DeleteQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error) -``` - -DeleteQueueConfiguration Delete queue configuration permanently from the system Returns nil if no error occurred - -### func \(\*WorkflowExecutor\) [ExecuteWorkflow]() - -```go -func (e *WorkflowExecutor) ExecuteWorkflow(startWorkflowRequest *model.StartWorkflowRequest, waitUntilTask string) (run *model.WorkflowRun, err error) -``` - -ExecuteWorkflow start a workflow and wait until the workflow completes or the waitUntilTask completes Returns the output of the workflow - -### func \(\*WorkflowExecutor\) [GetByCorrelationIds]() - -```go -func (e *WorkflowExecutor) GetByCorrelationIds(workflowName string, includeClosed bool, includeTasks bool, correlationIds ...string) (map[string][]model.Workflow, error) -``` - -GetByCorrelationIds Given the list of correlation ids, find and return workflows Returns a map with key as correlationId and value as a list of Workflows When IncludeClosed is set to true, the return value also includes workflows that are completed otherwise only running workflows are returned - -### func \(\*WorkflowExecutor\) [GetQueueConfiguration]() - -```go -func (e *WorkflowExecutor) GetQueueConfiguration(queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error) -``` - -GetQueueConfiguration Get queue configuration if present Returns queue configuration if present - -### func \(\*WorkflowExecutor\) [GetTask]() - -```go -func (e *WorkflowExecutor) GetTask(taskId string) (task *model.Task, err error) -``` - -GetTask by task Id returns nil if no such task is found by the id - -### func \(\*WorkflowExecutor\) [GetWorkflow]() - -```go -func (e *WorkflowExecutor) GetWorkflow(workflowId string, includeTasks bool) (*model.Workflow, error) -``` - -GetWorkflow Get workflow execution by workflow Id. If includeTasks is set, also fetches all the task details. Returns nil if no workflow is found by the id - -### func \(\*WorkflowExecutor\) [GetWorkflowStatus]() - -```go -func (e *WorkflowExecutor) GetWorkflowStatus(workflowId string, includeOutput bool, includeVariables bool) (*model.WorkflowState, error) -``` - -GetWorkflowStatus Get the status of the workflow execution. This is a lightweight method that returns only overall state of the workflow - -### func \(\*WorkflowExecutor\) [MonitorExecution]() - -```go -func (e *WorkflowExecutor) MonitorExecution(workflowId string) (workflowMonitor WorkflowExecutionChannel, err error) -``` - -MonitorExecution monitors the workflow execution Returns the channel with the execution result of the workflow Note: Channels will continue to grow if the workflows do not complete and/or are not taken out - -### func \(\*WorkflowExecutor\) [Pause]() - -```go -func (e *WorkflowExecutor) Pause(workflowId string) error -``` - -Pause the execution of a running workflow. Any tasks that are currently running will finish but no new tasks are scheduled until the workflow is resumed - -### func \(\*WorkflowExecutor\) [PutQueueConfiguration]() - -```go -func (e *WorkflowExecutor) PutQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error) -``` - -GetQueueConfiguration Create or update a queue configuration Returns nil if no error occurred - -### func \(\*WorkflowExecutor\) [ReRun]() - -```go -func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error) -``` - -ReRun a completed workflow from a specific task \(ReRunFromTaskId\) and optionally change the input Also update the completed tasks with new input \(ReRunFromTaskId\) if required - -### func \(\*WorkflowExecutor\) [RegisterWorkflow]() - -```go -func (e *WorkflowExecutor) RegisterWorkflow(overwrite bool, workflow *model.WorkflowDef) error -``` - -RegisterWorkflow Registers the workflow on the server. Overwrites if the flag is set. If the 'overwrite' flag is not set and the workflow definition differs from the one on the server, the call will fail with response code 409 - -### func \(\*WorkflowExecutor\) [RemoveWorkflow]() - -```go -func (e *WorkflowExecutor) RemoveWorkflow(workflowId string) error -``` - -RemoveWorkflow Remove workflow execution permanently from the system Returns nil if no workflow is found by the id - -### func \(\*WorkflowExecutor\) [Restart]() - -```go -func (e *WorkflowExecutor) Restart(workflowId string, useLatestDefinition bool) error -``` - -Restart a workflow execution from the beginning with the same input. When called on a workflow that is not in a terminal status, this operation has no effect If useLatestDefinition is set, the restarted workflow fetches the latest definition from the metadata store - -### func \(\*WorkflowExecutor\) [Resume]() - -```go -func (e *WorkflowExecutor) Resume(workflowId string) error -``` - -Resume the execution of a workflow that is paused. If the workflow is not paused, this method has no effect - -### func \(\*WorkflowExecutor\) [Retry]() - -```go -func (e *WorkflowExecutor) Retry(workflowId string, resumeSubworkflowTasks bool) error -``` - -Retry a failed workflow from the last task that failed. When called the task in the failed state is scheduled again and workflow moves to RUNNING status. If resumeSubworkflowTasks is set and the last failed task was a sub\-workflow the server restarts the subworkflow from the failed task. If set to false, the sub\-workflow is re\-executed. - -### func \(\*WorkflowExecutor\) [Search]() - -```go -func (e *WorkflowExecutor) Search(start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error) -``` - -#### Search searches for workflows - -\- Start: Start index \- used for pagination - -\- Size: Number of results to return - -``` -- Query: Query expression. In the format FIELD = 'VALUE' or FIELD IN (value1, value2) - Only AND operations are supported. e.g. workflowId IN ('a', 'b', 'c') ADN workflowType ='test_workflow' - AND startTime BETWEEN 1000 and 2000 - Supported fields for Query are:workflowId,workflowType,status,startTime -- FreeText: Full text search. All the workflow input, output and task outputs upto certain limit (check with your admins to find the size limit) - are full text indexed and can be used to search -``` - -### func \(\*WorkflowExecutor\) [SkipTasksFromWorkflow]() - -```go -func (e *WorkflowExecutor) SkipTasksFromWorkflow(workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest) error -``` - -SkipTasksFromWorkflow Skips a given task execution from a current running workflow. When skipped the task's input and outputs are updated from skipTaskRequest parameter. - -### func \(\*WorkflowExecutor\) [StartWorkflow]() - -```go -func (e *WorkflowExecutor) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error) -``` - -StartWorkflow Start workflows Returns the id of the newly created workflow - -### func \(\*WorkflowExecutor\) [StartWorkflows]() - -```go -func (e *WorkflowExecutor) StartWorkflows(monitorExecution bool, startWorkflowRequests ...*model.StartWorkflowRequest) []*RunningWorkflow -``` - -StartWorkflows Start workflows in bulk Returns RunningWorkflow struct that contains the workflowId, Err \(if failed to start\) and an execution channel which can be used to monitor the completion of the workflow execution. The channel is available if monitorExecution is set - -### func \(\*WorkflowExecutor\) [Terminate]() - -```go -func (e *WorkflowExecutor) Terminate(workflowId string, reason string) error -``` - -Terminate a running workflow. Reason must be provided that is captured as the termination resaon for the workflow. - -```go -func (e *WorkflowExecutor) TerminateWithFailure(workflowId string, reason string, triggerFailureWorkflow bool) error -``` - -Terminate a running workflow. Reason must be provided that is captured as the termination resaon for the workflow. -triggerFailureWorkflow is a boolean flag which when set to true will trigger failureWorkflow upon termination, if avaliable. - -### func \(\*WorkflowExecutor\) [UpdateTask]() - -```go -func (e *WorkflowExecutor) UpdateTask(taskId string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error -``` - -UpdateTask update the task with output and status. - -### func \(\*WorkflowExecutor\) [UpdateTaskByRefName]() - -```go -func (e *WorkflowExecutor) UpdateTaskByRefName(taskRefName string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error -``` - -UpdateTaskByRefName Update the execution status and output of the task and status - -### func \(\*WorkflowExecutor\) [WaitForRunningWorkflowsUntilTimeout]() - -```go -func (e *WorkflowExecutor) WaitForRunningWorkflowsUntilTimeout(timeout time.Duration, runningWorkflows ...*RunningWorkflow) -``` - -WaitForRunningWorkflowUntilTimeout Helper method to wait for running workflows until the timeout for the workflow execution to complete - -## type [WorkflowMonitor]() - -```go -type WorkflowMonitor struct { - // contains filtered or unexported fields -} -``` - -### func [NewWorkflowMonitor]() - -```go -func NewWorkflowMonitor(workflowClient *client.WorkflowResourceApiService) *WorkflowMonitor -``` diff --git a/docs/settings.md b/docs/settings.md deleted file mode 100644 index 2918a664..00000000 --- a/docs/settings.md +++ /dev/null @@ -1,110 +0,0 @@ - - -# settings - -```go -import "github.com/conductor-sdk/conductor-go/sdk/settings" -``` - -## Index - -- [type AuthenticationSettings](<#type-authenticationsettings>) - - [func NewAuthenticationSettings(keyId string, keySecret string) *AuthenticationSettings](<#func-newauthenticationsettings>) - - [func (s *AuthenticationSettings) GetBody() map[string]string](<#func-authenticationsettings-getbody>) -- [type ExternalStorageSettings](<#type-externalstoragesettings>) - - [func NewExternalStorageSettings(taskOutputPayloadThresholdKB int64, taskOutputMaxPayloadThresholdKB int64, externalStorageHandler model.ExternalStorageHandler) *ExternalStorageSettings](<#func-newexternalstoragesettings>) -- [type HttpSettings](<#type-httpsettings>) - - [func NewHttpDefaultSettings() *HttpSettings](<#func-newhttpdefaultsettings>) - - [func NewHttpSettings(baseUrl string) *HttpSettings](<#func-newhttpsettings>) -- [type MetricsSettings](<#type-metricssettings>) - - [func NewDefaultMetricsSettings() *MetricsSettings](<#func-newdefaultmetricssettings>) - - [func NewMetricsSettings(apiEndpoint string, port int) *MetricsSettings](<#func-newmetricssettings>) - - -## type [AuthenticationSettings]() - -```go -type AuthenticationSettings struct { - // contains filtered or unexported fields -} -``` - -### func [NewAuthenticationSettings]() - -```go -func NewAuthenticationSettings(keyId string, keySecret string) *AuthenticationSettings -``` - -### func \(\*AuthenticationSettings\) [GetBody]() - -```go -func (s *AuthenticationSettings) GetBody() map[string]string -``` - -## type [ExternalStorageSettings]() - -```go -type ExternalStorageSettings struct { - TaskOutputPayloadThresholdKB int64 - TaskOutputMaxPayloadThresholdKB int64 - ExternalStorageHandler model.ExternalStorageHandler -} -``` - -### func [NewExternalStorageSettings]() - -```go -func NewExternalStorageSettings(taskOutputPayloadThresholdKB int64, taskOutputMaxPayloadThresholdKB int64, externalStorageHandler model.ExternalStorageHandler) *ExternalStorageSettings -``` - -## type [HttpSettings]() - -```go -type HttpSettings struct { - BaseUrl string - Headers map[string]string -} -``` - -### func [NewHttpDefaultSettings]() - -```go -func NewHttpDefaultSettings() *HttpSettings -``` - -### func [NewHttpSettings]() - -```go -func NewHttpSettings(baseUrl string) *HttpSettings -``` - -## type [MetricsSettings]() - -MetricsSettings configures the prometheus metrics for worker SDK - -```go -type MetricsSettings struct { - ApiEndpoint string - Port int -} -``` - -### func [NewDefaultMetricsSettings]() - -```go -func NewDefaultMetricsSettings() *MetricsSettings -``` - -NewDefaultMetricsSettings creates an endpoint at /metrics on port 2112 - -### func [NewMetricsSettings]() - -```go -func NewMetricsSettings(apiEndpoint string, port int) *MetricsSettings -``` - -NewMetricsSettings new metrics settings with endpoint and port - - - -Generated by [gomarkdoc]() diff --git a/docs/worker.md b/docs/worker.md deleted file mode 100644 index 950eb458..00000000 --- a/docs/worker.md +++ /dev/null @@ -1,132 +0,0 @@ - - -# worker - -```go -import "github.com/conductor-sdk/conductor-go/sdk/worker" -``` - -## Index - -- [type TaskRunner](<#type-taskrunner>) - - [func NewTaskRunner(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings) *TaskRunner](<#func-newtaskrunner>) - - [func NewTaskRunnerWithApiClient(apiClient *client.APIClient) *TaskRunner](<#func-newtaskrunnerwithapiclient>) - - [func (c *TaskRunner) DecreaseBatchSize(taskName string, batchSize int) error](<#func-taskrunner-decreasebatchsize>) - - [func (c *TaskRunner) GetBatchSizeForAll() (batchSizeByTaskName map[string]int)](<#func-taskrunner-getbatchsizeforall>) - - [func (c *TaskRunner) GetBatchSizeForTask(taskName string) (batchSize int)](<#func-taskrunner-getbatchsizefortask>) - - [func (c *TaskRunner) GetPollIntervalForTask(taskName string) (pollInterval time.Duration, err error)](<#func-taskrunner-getpollintervalfortask>) - - [func (c *TaskRunner) IncreaseBatchSize(taskName string, batchSize int) error](<#func-taskrunner-increasebatchsize>) - - [func (c *TaskRunner) Pause(taskName string)](<#func-taskrunner-pause>) - - [func (c *TaskRunner) Resume(taskName string)](<#func-taskrunner-resume>) - - [func (c *TaskRunner) SetBatchSize(taskName string, batchSize int) error](<#func-taskrunner-setbatchsize>) - - [func (c *TaskRunner) SetPollIntervalForTask(taskName string, pollInterval time.Duration) error](<#func-taskrunner-setpollintervalfortask>) - - [func (c *TaskRunner) StartWorker(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration) error](<#func-taskrunner-startworker>) - - [func (c *TaskRunner) StartWorkerWithDomain(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration, domain string) error](<#func-taskrunner-startworkerwithdomain>) - - [func (c *TaskRunner) WaitWorkers()](<#func-taskrunner-waitworkers>) - - -## type [TaskRunner]() - -TaskRunner Runner for the Task Workers. Task Runners implements the polling and execution logic for the workers - -```go -type TaskRunner struct { - // contains filtered or unexported fields -} -``` - -### func [NewTaskRunner]() - -```go -func NewTaskRunner(authenticationSettings *settings.AuthenticationSettings, httpSettings *settings.HttpSettings) *TaskRunner -``` - -### func [NewTaskRunnerWithApiClient]() - -```go -func NewTaskRunnerWithApiClient(apiClient *client.APIClient) *TaskRunner -``` - -### func \(\*TaskRunner\) [DecreaseBatchSize]() - -```go -func (c *TaskRunner) DecreaseBatchSize(taskName string, batchSize int) error -``` - -### func \(\*TaskRunner\) [GetBatchSizeForAll]() - -```go -func (c *TaskRunner) GetBatchSizeForAll() (batchSizeByTaskName map[string]int) -``` - -### func \(\*TaskRunner\) [GetBatchSizeForTask]() - -```go -func (c *TaskRunner) GetBatchSizeForTask(taskName string) (batchSize int) -``` - -### func \(\*TaskRunner\) [GetPollIntervalForTask]() - -```go -func (c *TaskRunner) GetPollIntervalForTask(taskName string) (pollInterval time.Duration, err error) -``` - -### func \(\*TaskRunner\) [IncreaseBatchSize]() - -```go -func (c *TaskRunner) IncreaseBatchSize(taskName string, batchSize int) error -``` - -### func \(\*TaskRunner\) [Pause]() - -```go -func (c *TaskRunner) Pause(taskName string) -``` - -Pause a running worker. When paused worker will not poll for new task. Worker must be resumed using Resume - -### func \(\*TaskRunner\) [Resume]() - -```go -func (c *TaskRunner) Resume(taskName string) -``` - -Resume a running worker. If the worker is not paused, calling this method has no impact - -### func \(\*TaskRunner\) [SetBatchSize]() - -```go -func (c *TaskRunner) SetBatchSize(taskName string, batchSize int) error -``` - -### func \(\*TaskRunner\) [SetPollIntervalForTask]() - -```go -func (c *TaskRunner) SetPollIntervalForTask(taskName string, pollInterval time.Duration) error -``` - -### func \(\*TaskRunner\) [StartWorker]() - -```go -func (c *TaskRunner) StartWorker(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration) error -``` - -StartWorker \- taskName Task name to poll and execute the work \- executeFunction Task execution function \- batchSize Amount of tasks to be polled. Each polled task will be executed and updated within its own unique goroutine. \- pollInterval Time to wait for between polls if there are no tasks available. Reduces excessive polling on the server when there is no work - -### func \(\*TaskRunner\) [StartWorkerWithDomain]() - -```go -func (c *TaskRunner) StartWorkerWithDomain(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration, domain string) error -``` - -StartWorkerWithDomain \- taskName Task name to poll and execute the work \- executeFunction Task execution function \- batchSize Amount of tasks to be polled. Each polled task will be executed and updated within its own unique goroutine. \- pollInterval Time to wait for between polls if there are no tasks available. Reduces excessive polling on the server when there is no work \- domain Task domain. Optional for polling - -### func \(\*TaskRunner\) [WaitWorkers]() - -```go -func (c *TaskRunner) WaitWorkers() -``` - - - -Generated by [gomarkdoc]() diff --git a/docs/workflow.md b/docs/workflow.md deleted file mode 100644 index 3b5a24d9..00000000 --- a/docs/workflow.md +++ /dev/null @@ -1,1417 +0,0 @@ - - -# workflow - -```go -import "github.com/conductor-sdk/conductor-go/sdk/workflow" -``` - -## Index - -- [Constants](<#constants>) -- [type ConductorWorkflow](<#type-conductorworkflow>) - - [func NewConductorWorkflow(executor *executor.WorkflowExecutor) *ConductorWorkflow](<#func-newconductorworkflow>) - - [func (workflow *ConductorWorkflow) Add(task TaskInterface) *ConductorWorkflow](<#func-conductorworkflow-add>) - - [func (workflow *ConductorWorkflow) Description(description string) *ConductorWorkflow](<#func-conductorworkflow-description>) - - [func (workflow *ConductorWorkflow) FailureWorkflow(failureWorkflow string) *ConductorWorkflow](<#func-conductorworkflow-failureworkflow>) - - [func (workflow *ConductorWorkflow) GetName() (name string)](<#func-conductorworkflow-getname>) - - [func (workflow *ConductorWorkflow) GetVersion() (version int32)](<#func-conductorworkflow-getversion>) - - [func (workflow *ConductorWorkflow) InputParameters(inputParameters ...string) *ConductorWorkflow](<#func-conductorworkflow-inputparameters>) - - [func (workflow *ConductorWorkflow) InputTemplate(inputTemplate interface{}) *ConductorWorkflow](<#func-conductorworkflow-inputtemplate>) - - [func (workflow *ConductorWorkflow) Name(name string) *ConductorWorkflow](<#func-conductorworkflow-name>) - - [func (workflow *ConductorWorkflow) OutputParameters(outputParameters interface{}) *ConductorWorkflow](<#func-conductorworkflow-outputparameters>) - - [func (workflow *ConductorWorkflow) OwnerEmail(ownerEmail string) *ConductorWorkflow](<#func-conductorworkflow-owneremail>) - - [func (workflow *ConductorWorkflow) Register(overwrite bool) error](<#func-conductorworkflow-register>) - - [func (workflow *ConductorWorkflow) Restartable(restartable bool) *ConductorWorkflow](<#func-conductorworkflow-restartable>) - - [func (workflow *ConductorWorkflow) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)](<#func-conductorworkflow-startworkflow>) - - [func (workflow *ConductorWorkflow) StartWorkflowWithInput(input interface{}) (workflowId string, err error)](<#func-conductorworkflow-startworkflowwithinput>) - - [func (workflow *ConductorWorkflow) StartWorkflowsAndMonitorExecution(startWorkflowRequest *model.StartWorkflowRequest) (executionChannel executor.WorkflowExecutionChannel, err error)](<#func-conductorworkflow-startworkflowsandmonitorexecution>) - - [func (workflow *ConductorWorkflow) TimeoutPolicy(timeoutPolicy TimeoutPolicy, timeoutSeconds int64) *ConductorWorkflow](<#func-conductorworkflow-timeoutpolicy>) - - [func (workflow *ConductorWorkflow) TimeoutSeconds(timeoutSeconds int64) *ConductorWorkflow](<#func-conductorworkflow-timeoutseconds>) - - [func (workflow *ConductorWorkflow) ToWorkflowDef() *model.WorkflowDef](<#func-conductorworkflow-toworkflowdef>) - - [func (workflow *ConductorWorkflow) Variables(variables interface{}) *ConductorWorkflow](<#func-conductorworkflow-variables>) - - [func (workflow *ConductorWorkflow) Version(version int32) *ConductorWorkflow](<#func-conductorworkflow-version>) -- [type DoWhileTask](<#type-dowhiletask>) - - [func NewDoWhileTask(taskRefName string, terminationCondition string, tasks ...TaskInterface) *DoWhileTask](<#func-newdowhiletask>) - - [func NewLoopTask(taskRefName string, iterations int32, tasks ...TaskInterface) *DoWhileTask](<#func-newlooptask>) - - [func (task *DoWhileTask) Description(description string) *DoWhileTask](<#func-dowhiletask-description>) - - [func (task *DoWhileTask) Input(key string, value interface{}) *DoWhileTask](<#func-dowhiletask-input>) - - [func (task *DoWhileTask) InputMap(inputMap map[string]interface{}) *DoWhileTask](<#func-dowhiletask-inputmap>) - - [func (task *DoWhileTask) Optional(optional bool) *DoWhileTask](<#func-dowhiletask-optional>) -- [type DynamicForkInput](<#type-dynamicforkinput>) -- [type DynamicForkTask](<#type-dynamicforktask>) - - [func NewDynamicForkTask(taskRefName string, forkPrepareTask TaskInterface) *DynamicForkTask](<#func-newdynamicforktask>) - - [func NewDynamicForkWithJoinTask(taskRefName string, forkPrepareTask TaskInterface, join JoinTask) *DynamicForkTask](<#func-newdynamicforkwithjointask>) - - [func (task *DynamicForkTask) Description(description string) *DynamicForkTask](<#func-dynamicforktask-description>) - - [func (task *DynamicForkTask) Input(key string, value interface{}) *DynamicForkTask](<#func-dynamicforktask-input>) - - [func (task *DynamicForkTask) InputMap(inputMap map[string]interface{}) *DynamicForkTask](<#func-dynamicforktask-inputmap>) - - [func (task *DynamicForkTask) Optional(optional bool) *DynamicForkTask](<#func-dynamicforktask-optional>) -- [type DynamicTask](<#type-dynamictask>) - - [func NewDynamicTask(taskRefName string, taskNameParameter string) *DynamicTask](<#func-newdynamictask>) - - [func (task *DynamicTask) Description(description string) *DynamicTask](<#func-dynamictask-description>) - - [func (task *DynamicTask) Input(key string, value interface{}) *DynamicTask](<#func-dynamictask-input>) - - [func (task *DynamicTask) InputMap(inputMap map[string]interface{}) *DynamicTask](<#func-dynamictask-inputmap>) - - [func (task *DynamicTask) Optional(optional bool) *DynamicTask](<#func-dynamictask-optional>) -- [type EventTask](<#type-eventtask>) - - [func NewConductorEventTask(taskRefName string, eventName string) *EventTask](<#func-newconductoreventtask>) - - [func NewSqsEventTask(taskRefName string, queueName string) *EventTask](<#func-newsqseventtask>) - - [func (task *EventTask) Description(description string) *EventTask](<#func-eventtask-description>) - - [func (task *EventTask) Input(key string, value interface{}) *EventTask](<#func-eventtask-input>) - - [func (task *EventTask) InputMap(inputMap map[string]interface{}) *EventTask](<#func-eventtask-inputmap>) - - [func (task *EventTask) Optional(optional bool) *EventTask](<#func-eventtask-optional>) -- [type ForkTask](<#type-forktask>) - - [func NewForkTask(taskRefName string, forkedTask ...[]TaskInterface) *ForkTask](<#func-newforktask>) - - [func (task *ForkTask) Description(description string) *ForkTask](<#func-forktask-description>) - - [func (task *ForkTask) Input(key string, value interface{}) *ForkTask](<#func-forktask-input>) - - [func (task *ForkTask) InputMap(inputMap map[string]interface{}) *ForkTask](<#func-forktask-inputmap>) - - [func (task *ForkTask) Optional(optional bool) *ForkTask](<#func-forktask-optional>) -- [type HttpInput](<#type-httpinput>) -- [type HttpMethod](<#type-httpmethod>) -- [type HttpTask](<#type-httptask>) - - [func NewHttpTask(taskRefName string, input *HttpInput) *HttpTask](<#func-newhttptask>) - - [func (task *HttpTask) Description(description string) *HttpTask](<#func-httptask-description>) - - [func (task *HttpTask) Input(key string, value interface{}) *HttpTask](<#func-httptask-input>) - - [func (task *HttpTask) InputMap(inputMap map[string]interface{}) *HttpTask](<#func-httptask-inputmap>) - - [func (task *HttpTask) Optional(optional bool) *HttpTask](<#func-httptask-optional>) -- [type HumanTask](<#type-humantask>) - - [func NewHumanTask(taskRefName string) *HumanTask](<#func-newhumantask>) - - [func (task *HumanTask) Description(description string) *HumanTask](<#func-humantask-description>) - - [func (task *HumanTask) Input(key string, value interface{}) *HumanTask](<#func-humantask-input>) - - [func (task *HumanTask) InputMap(inputMap map[string]interface{}) *HumanTask](<#func-humantask-inputmap>) - - [func (task *HumanTask) Optional(optional bool) *HumanTask](<#func-humantask-optional>) -- [type InlineTask](<#type-inlinetask>) - - [func NewInlineTask(name string, script string) *InlineTask](<#func-newinlinetask>) - - [func (task *InlineTask) Description(description string) *InlineTask](<#func-inlinetask-description>) - - [func (task *InlineTask) Input(key string, value interface{}) *InlineTask](<#func-inlinetask-input>) - - [func (task *InlineTask) InputMap(inputMap map[string]interface{}) *InlineTask](<#func-inlinetask-inputmap>) - - [func (task *InlineTask) Optional(optional bool) *InlineTask](<#func-inlinetask-optional>) -- [type JQTask](<#type-jqtask>) - - [func NewJQTask(name string, script string) *JQTask](<#func-newjqtask>) - - [func (task *JQTask) Description(description string) *JQTask](<#func-jqtask-description>) - - [func (task *JQTask) Input(key string, value interface{}) *JQTask](<#func-jqtask-input>) - - [func (task *JQTask) InputMap(inputMap map[string]interface{}) *JQTask](<#func-jqtask-inputmap>) - - [func (task *JQTask) Optional(optional bool) *JQTask](<#func-jqtask-optional>) -- [type JoinTask](<#type-jointask>) - - [func NewJoinTask(taskRefName string, joinOn ...string) *JoinTask](<#func-newjointask>) - - [func (task *JoinTask) Description(description string) *JoinTask](<#func-jointask-description>) - - [func (task *JoinTask) Optional(optional bool) *JoinTask](<#func-jointask-optional>) -- [type KafkaPublishTask](<#type-kafkapublishtask>) - - [func NewKafkaPublishTask(taskRefName string, kafkaPublishTaskInput *KafkaPublishTaskInput) *KafkaPublishTask](<#func-newkafkapublishtask>) - - [func (task *KafkaPublishTask) Description(description string) *KafkaPublishTask](<#func-kafkapublishtask-description>) - - [func (task *KafkaPublishTask) Input(key string, value interface{}) *KafkaPublishTask](<#func-kafkapublishtask-input>) - - [func (task *KafkaPublishTask) InputMap(inputMap map[string]interface{}) *KafkaPublishTask](<#func-kafkapublishtask-inputmap>) - - [func (task *KafkaPublishTask) Optional(optional bool) *KafkaPublishTask](<#func-kafkapublishtask-optional>) -- [type KafkaPublishTaskInput](<#type-kafkapublishtaskinput>) -- [type SetVariableTask](<#type-setvariabletask>) - - [func NewSetVariableTask(taskRefName string) *SetVariableTask](<#func-newsetvariabletask>) - - [func (task *SetVariableTask) Description(description string) *SetVariableTask](<#func-setvariabletask-description>) - - [func (task *SetVariableTask) Input(key string, value interface{}) *SetVariableTask](<#func-setvariabletask-input>) - - [func (task *SetVariableTask) InputMap(inputMap map[string]interface{}) *SetVariableTask](<#func-setvariabletask-inputmap>) - - [func (task *SetVariableTask) Optional(optional bool) *SetVariableTask](<#func-setvariabletask-optional>) -- [type SimpleTask](<#type-simpletask>) - - [func NewSimpleTask(taskType string, taskRefName string) *SimpleTask](<#func-newsimpletask>) - - [func (task *SimpleTask) Description(description string) *SimpleTask](<#func-simpletask-description>) - - [func (task *SimpleTask) Input(key string, value interface{}) *SimpleTask](<#func-simpletask-input>) - - [func (task *SimpleTask) InputMap(inputMap map[string]interface{}) *SimpleTask](<#func-simpletask-inputmap>) - - [func (task *SimpleTask) Optional(optional bool) *SimpleTask](<#func-simpletask-optional>) -- [type StartWorkflowTask](<#type-startworkflowtask>) - - [func NewStartWorkflowTask(taskRefName string, workflowName string, version *int32, startWorkflowRequest *model.StartWorkflowRequest) *StartWorkflowTask](<#func-newstartworkflowtask>) - - [func (task *StartWorkflowTask) Description(description string) *StartWorkflowTask](<#func-startworkflowtask-description>) - - [func (task *StartWorkflowTask) Input(key string, value interface{}) *StartWorkflowTask](<#func-startworkflowtask-input>) - - [func (task *StartWorkflowTask) InputMap(inputMap map[string]interface{}) *StartWorkflowTask](<#func-startworkflowtask-inputmap>) - - [func (task *StartWorkflowTask) Optional(optional bool) *StartWorkflowTask](<#func-startworkflowtask-optional>) -- [type SubWorkflowTask](<#type-subworkflowtask>) - - [func NewSubWorkflowInlineTask(taskRefName string, workflow *ConductorWorkflow) *SubWorkflowTask](<#func-newsubworkflowinlinetask>) - - [func NewSubWorkflowTask(taskRefName string, workflowName string, version *int32) *SubWorkflowTask](<#func-newsubworkflowtask>) - - [func (task *SubWorkflowTask) Description(description string) *SubWorkflowTask](<#func-subworkflowtask-description>) - - [func (task *SubWorkflowTask) Input(key string, value interface{}) *SubWorkflowTask](<#func-subworkflowtask-input>) - - [func (task *SubWorkflowTask) InputMap(inputMap map[string]interface{}) *SubWorkflowTask](<#func-subworkflowtask-inputmap>) - - [func (task *SubWorkflowTask) Optional(optional bool) *SubWorkflowTask](<#func-subworkflowtask-optional>) - - [func (task *SubWorkflowTask) TaskToDomain(taskToDomainMap map[string]string) *SubWorkflowTask](<#func-subworkflowtask-tasktodomain>) -- [type SwitchTask](<#type-switchtask>) - - [func NewSwitchTask(taskRefName string, caseExpression string) *SwitchTask](<#func-newswitchtask>) - - [func (task *SwitchTask) DefaultCase(tasks ...TaskInterface) *SwitchTask](<#func-switchtask-defaultcase>) - - [func (task *SwitchTask) Description(description string) *SwitchTask](<#func-switchtask-description>) - - [func (task *SwitchTask) Input(key string, value interface{}) *SwitchTask](<#func-switchtask-input>) - - [func (task *SwitchTask) InputMap(inputMap map[string]interface{}) *SwitchTask](<#func-switchtask-inputmap>) - - [func (task *SwitchTask) Optional(optional bool) *SwitchTask](<#func-switchtask-optional>) - - [func (task *SwitchTask) SwitchCase(caseName string, tasks ...TaskInterface) *SwitchTask](<#func-switchtask-switchcase>) - - [func (task *SwitchTask) UseJavascript(use bool) *SwitchTask](<#func-switchtask-usejavascript>) -- [type Task](<#type-task>) - - [func (task *Task) Description(description string) *Task](<#func-task-description>) - - [func (task *Task) Input(key string, value interface{}) *Task](<#func-task-input>) - - [func (task *Task) InputMap(inputMap map[string]interface{}) *Task](<#func-task-inputmap>) - - [func (task *Task) Optional(optional bool) *Task](<#func-task-optional>) - - [func (task *Task) OutputRef(path string) string](<#func-task-outputref>) - - [func (task *Task) ReferenceName() string](<#func-task-referencename>) - - [func (task *Task) ToTaskDef() *model.TaskDef](<#func-task-totaskdef>) -- [type TaskInterface](<#type-taskinterface>) -- [type TaskType](<#type-tasktype>) -- [type TerminateTask](<#type-terminatetask>) - - [func NewTerminateTask(taskRefName string, status model.WorkflowStatus, terminationReason string) *TerminateTask](<#func-newterminatetask>) - - [func (task *TerminateTask) Description(description string) *TerminateTask](<#func-terminatetask-description>) - - [func (task *TerminateTask) Input(key string, value interface{}) *TerminateTask](<#func-terminatetask-input>) - - [func (task *TerminateTask) InputMap(inputMap map[string]interface{}) *TerminateTask](<#func-terminatetask-inputmap>) -- [type TimeoutPolicy](<#type-timeoutpolicy>) -- [type WaitTask](<#type-waittask>) - - [func NewWaitForDurationTask(taskRefName string, duration time.Duration) *WaitTask](<#func-newwaitfordurationtask>) - - [func NewWaitTask(taskRefName string) *WaitTask](<#func-newwaittask>) - - [func NewWaitUntilTask(taskRefName string, dateTime string) *WaitTask](<#func-newwaituntiltask>) - - [func (task *WaitTask) Description(description string) *WaitTask](<#func-waittask-description>) - - [func (task *WaitTask) Input(key string, value interface{}) *WaitTask](<#func-waittask-input>) - - [func (task *WaitTask) InputMap(inputMap map[string]interface{}) *WaitTask](<#func-waittask-inputmap>) - - [func (task *WaitTask) Optional(optional bool) *WaitTask](<#func-waittask-optional>) - - -## Constants - -```go -const ( - JavascriptEvaluator = "javascript" -) -``` - -## type [ConductorWorkflow]() - -```go -type ConductorWorkflow struct { - // contains filtered or unexported fields -} -``` - -### func [NewConductorWorkflow]() - -```go -func NewConductorWorkflow(executor *executor.WorkflowExecutor) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [Add]() - -```go -func (workflow *ConductorWorkflow) Add(task TaskInterface) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [Description]() - -```go -func (workflow *ConductorWorkflow) Description(description string) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [FailureWorkflow]() - -```go -func (workflow *ConductorWorkflow) FailureWorkflow(failureWorkflow string) *ConductorWorkflow -``` - -FailureWorkflow name of the workflow to execute when this workflow fails\. Failure workflows can be used for handling compensation logic - -### func \(\*ConductorWorkflow\) [GetName]() - -```go -func (workflow *ConductorWorkflow) GetName() (name string) -``` - -### func \(\*ConductorWorkflow\) [GetVersion]() - -```go -func (workflow *ConductorWorkflow) GetVersion() (version int32) -``` - -### func \(\*ConductorWorkflow\) [InputParameters]() - -```go -func (workflow *ConductorWorkflow) InputParameters(inputParameters ...string) *ConductorWorkflow -``` - -InputParameters List of the input parameters to the workflow\. Used ONLY for the documentation purpose\. - -### func \(\*ConductorWorkflow\) [InputTemplate]() - -```go -func (workflow *ConductorWorkflow) InputTemplate(inputTemplate interface{}) *ConductorWorkflow -``` - -InputTemplate template input to the workflow\. Can have combination of variables \(e\.g\. $\{workflow\.input\.abc\}\) and static values - -### func \(\*ConductorWorkflow\) [Name]() - -```go -func (workflow *ConductorWorkflow) Name(name string) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [OutputParameters]() - -```go -func (workflow *ConductorWorkflow) OutputParameters(outputParameters interface{}) *ConductorWorkflow -``` - -OutputParameters Workflow outputs\. Workflow output follows similar structure as task inputs See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for more details - -### func \(\*ConductorWorkflow\) [OwnerEmail]() - -```go -func (workflow *ConductorWorkflow) OwnerEmail(ownerEmail string) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [Register]() - -```go -func (workflow *ConductorWorkflow) Register(overwrite bool) error -``` - -Register the workflow definition with the server\. If overwrite is set\, the definition on the server will be overwritten\. When not set\, the call fails if there is any change in the workflow definition between the server and what is being registered\. - -### func \(\*ConductorWorkflow\) [Restartable]() - -```go -func (workflow *ConductorWorkflow) Restartable(restartable bool) *ConductorWorkflow -``` - -Restartable if the workflow can be restarted after it has reached terminal state\. Set this to false if restarting workflow can have side effects - -### func \(\*ConductorWorkflow\) [StartWorkflow]() - -```go -func (workflow *ConductorWorkflow) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error) -``` - -StartWorkflow starts the workflow execution with startWorkflowRequest that allows you to specify more details like task domains\, correlationId etc\. Returns the ID of the newly created workflow - -### func \(\*ConductorWorkflow\) [StartWorkflowWithInput]() - -```go -func (workflow *ConductorWorkflow) StartWorkflowWithInput(input interface{}) (workflowId string, err error) -``` - -StartWorkflowWithInput ExecuteWorkflowWithInput Execute the workflow with specific input\. The input struct MUST be serializable to JSON Returns the workflow Id that can be used to monitor and get the status of the workflow execution - -### func \(\*ConductorWorkflow\) [StartWorkflowsAndMonitorExecution]() - -```go -func (workflow *ConductorWorkflow) StartWorkflowsAndMonitorExecution(startWorkflowRequest *model.StartWorkflowRequest) (executionChannel executor.WorkflowExecutionChannel, err error) -``` - -StartWorkflowsAndMonitorExecution Starts the workflow execution and returns a channel that can be used to monitor the workflow execution This method is useful for short duration workflows that are expected to complete in few seconds\. For long\-running workflows use GetStatus APIs to periodically check the status - -### func \(\*ConductorWorkflow\) [TimeoutPolicy]() - -```go -func (workflow *ConductorWorkflow) TimeoutPolicy(timeoutPolicy TimeoutPolicy, timeoutSeconds int64) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [TimeoutSeconds]() - -```go -func (workflow *ConductorWorkflow) TimeoutSeconds(timeoutSeconds int64) *ConductorWorkflow -``` - -### func \(\*ConductorWorkflow\) [ToWorkflowDef]() - -```go -func (workflow *ConductorWorkflow) ToWorkflowDef() *model.WorkflowDef -``` - -ToWorkflowDef converts the workflow to the JSON serializable format - -### func \(\*ConductorWorkflow\) [Variables]() - -```go -func (workflow *ConductorWorkflow) Variables(variables interface{}) *ConductorWorkflow -``` - -Variables Workflow variables are set using SET\_VARIABLE task\. Excellent way to maintain business state e\.g\. Variables can maintain business/user specific states which can be queried and inspected to find out the state of the workflow - -### func \(\*ConductorWorkflow\) [Version]() - -```go -func (workflow *ConductorWorkflow) Version(version int32) *ConductorWorkflow -``` - -## type [DoWhileTask]() - -DoWhileTask Do\.\.\.While task - -```go -type DoWhileTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewDoWhileTask]() - -```go -func NewDoWhileTask(taskRefName string, terminationCondition string, tasks ...TaskInterface) *DoWhileTask -``` - -NewDoWhileTask DoWhileTask Crate a new DoWhile task\. terminationCondition is a Javascript expression that evaluates to True or False - -### func [NewLoopTask]() - -```go -func NewLoopTask(taskRefName string, iterations int32, tasks ...TaskInterface) *DoWhileTask -``` - -NewLoopTask Loop over N times when N is specified as iterations - -### func \(\*DoWhileTask\) [Description]() - -```go -func (task *DoWhileTask) Description(description string) *DoWhileTask -``` - -Description of the task - -### func \(\*DoWhileTask\) [Input]() - -```go -func (task *DoWhileTask) Input(key string, value interface{}) *DoWhileTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*DoWhileTask\) [InputMap]() - -```go -func (task *DoWhileTask) InputMap(inputMap map[string]interface{}) *DoWhileTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*DoWhileTask\) [Optional]() - -```go -func (task *DoWhileTask) Optional(optional bool) *DoWhileTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [DynamicForkInput]() - -### DynamicForkInput struct that represents the output of the dynamic fork preparatory task - -DynamicFork requires inputs that specifies the list of tasks to be executed in parallel along with the inputs to each of these tasks\. This usually means having another task before the dynamic task whose output contains the tasks to be forked\. - -This struct represents the output of such a task - -```go -type DynamicForkInput struct { - Tasks []model.WorkflowTask - TaskInput map[string]interface{} -} -``` - -## type [DynamicForkTask]() - -```go -type DynamicForkTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewDynamicForkTask]() - -```go -func NewDynamicForkTask(taskRefName string, forkPrepareTask TaskInterface) *DynamicForkTask -``` - -### func [NewDynamicForkWithJoinTask]() - -```go -func NewDynamicForkWithJoinTask(taskRefName string, forkPrepareTask TaskInterface, join JoinTask) *DynamicForkTask -``` - -### func \(\*DynamicForkTask\) [Description]() - -```go -func (task *DynamicForkTask) Description(description string) *DynamicForkTask -``` - -Description of the task - -### func \(\*DynamicForkTask\) [Input]() - -```go -func (task *DynamicForkTask) Input(key string, value interface{}) *DynamicForkTask -``` - -Input to the task - -### func \(\*DynamicForkTask\) [InputMap]() - -```go -func (task *DynamicForkTask) InputMap(inputMap map[string]interface{}) *DynamicForkTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*DynamicForkTask\) [Optional]() - -```go -func (task *DynamicForkTask) Optional(optional bool) *DynamicForkTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [DynamicTask]() - -```go -type DynamicTask struct { - Task -} -``` - -### func [NewDynamicTask]() - -```go -func NewDynamicTask(taskRefName string, taskNameParameter string) *DynamicTask -``` - -NewDynamicTask \- taskRefName Reference name for the task\. MUST be unique within the workflow \- taskNameParameter Parameter that contains the expression for the dynamic task name\. e\.g\. $\{workflow\.input\.dynamicTask\} - -### func \(\*DynamicTask\) [Description]() - -```go -func (task *DynamicTask) Description(description string) *DynamicTask -``` - -Description of the task - -### func \(\*DynamicTask\) [Input]() - -```go -func (task *DynamicTask) Input(key string, value interface{}) *DynamicTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*DynamicTask\) [InputMap]() - -```go -func (task *DynamicTask) InputMap(inputMap map[string]interface{}) *DynamicTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*DynamicTask\) [Optional]() - -```go -func (task *DynamicTask) Optional(optional bool) *DynamicTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [EventTask]() - -EventTask Task to publish Events to external queuing systems like SQS\, NATS\, AMQP etc\. - -```go -type EventTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewConductorEventTask]() - -```go -func NewConductorEventTask(taskRefName string, eventName string) *EventTask -``` - -### func [NewSqsEventTask]() - -```go -func NewSqsEventTask(taskRefName string, queueName string) *EventTask -``` - -### func \(\*EventTask\) [Description]() - -```go -func (task *EventTask) Description(description string) *EventTask -``` - -Description of the task - -### func \(\*EventTask\) [Input]() - -```go -func (task *EventTask) Input(key string, value interface{}) *EventTask -``` - -Input to the task - -### func \(\*EventTask\) [InputMap]() - -```go -func (task *EventTask) InputMap(inputMap map[string]interface{}) *EventTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*EventTask\) [Optional]() - -```go -func (task *EventTask) Optional(optional bool) *EventTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [ForkTask]() - -```go -type ForkTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewForkTask]() - -```go -func NewForkTask(taskRefName string, forkedTask ...[]TaskInterface) *ForkTask -``` -
-execute task specified in the forkedTasks parameter in parallel.
-forkedTask is a two-dimensional list that executes the outermost list in parallel and list within that is executed sequentially.
-
-e.g. [[task1, task2],[task3, task4],[task5]] are executed as:
-
-
-                    ---------------
-                    |     fork    |
-                    ---------------
-                    |       |     |
-                    |       |     |
-                  task1  task3  task5
-                  task2  task4    |
-                    |      |      |
-                 ---------------------
-                 |       join        |
-                 ---------------------
-
-
- This method automatically adds a join that waits for all the last tasks in the fork
- (e.g. task2, task4 and task5 in the above example) to be completed.
-
-
-### func \(\*ForkTask\) [Description]() - -```go -func (task *ForkTask) Description(description string) *ForkTask -``` - -Description of the task - -### func \(\*ForkTask\) [Input]() - -```go -func (task *ForkTask) Input(key string, value interface{}) *ForkTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*ForkTask\) [InputMap]() - -```go -func (task *ForkTask) InputMap(inputMap map[string]interface{}) *ForkTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*ForkTask\) [Optional]() - -```go -func (task *ForkTask) Optional(optional bool) *ForkTask -``` - -Optional if set to true\, the task will not fail the workflow if one of the loop task fails - -## type [HttpInput]() - -HttpInput Input to the HTTP task - -```go -type HttpInput struct { - Method HttpMethod `json:"method"` - Uri string `json:"uri"` - Headers map[string][]string `json:"headers,omitempty"` - Accept string `json:"accept,omitempty"` - ContentType string `json:"contentType,omitempty"` - ConnectionTimeOut int16 `json:"ConnectionTimeOut,omitempty"` - ReadTimeout int16 `json:"readTimeout,omitempty"` - Body interface{} `json:"body,omitempty"` -} -``` - -## type [HttpMethod]() - -```go -type HttpMethod string -``` - -```go -const ( - GET HttpMethod = "GET" - PUT HttpMethod = "PUT" - POST HttpMethod = "POST" - DELETE HttpMethod = "DELETE" - HEAD HttpMethod = "HEAD" - OPTIONS HttpMethod = "OPTIONS" -) -``` - -## type [HttpTask]() - -```go -type HttpTask struct { - Task -} -``` - -### func [NewHttpTask]() - -```go -func NewHttpTask(taskRefName string, input *HttpInput) *HttpTask -``` - -NewHttpTask Create a new HTTP Task - -### func \(\*HttpTask\) [Description]() - -```go -func (task *HttpTask) Description(description string) *HttpTask -``` - -Description of the task - -### func \(\*HttpTask\) [Input]() - -```go -func (task *HttpTask) Input(key string, value interface{}) *HttpTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*HttpTask\) [InputMap]() - -```go -func (task *HttpTask) InputMap(inputMap map[string]interface{}) *HttpTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*HttpTask\) [Optional]() - -```go -func (task *HttpTask) Optional(optional bool) *HttpTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [HumanTask]() - -```go -type HumanTask struct { - Task -} -``` - -### func [NewHumanTask]() - -```go -func NewHumanTask(taskRefName string) *HumanTask -``` - -### func \(\*HumanTask\) [Description]() - -```go -func (task *HumanTask) Description(description string) *HumanTask -``` - -Description of the task - -### func \(\*HumanTask\) [Input]() - -```go -func (task *HumanTask) Input(key string, value interface{}) *HumanTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*HumanTask\) [InputMap]() - -```go -func (task *HumanTask) InputMap(inputMap map[string]interface{}) *HumanTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*HumanTask\) [Optional]() - -```go -func (task *HumanTask) Optional(optional bool) *HumanTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [InlineTask]() - -```go -type InlineTask struct { - Task -} -``` - -### func [NewInlineTask]() - -```go -func NewInlineTask(name string, script string) *InlineTask -``` - -### func \(\*InlineTask\) [Description]() - -```go -func (task *InlineTask) Description(description string) *InlineTask -``` - -Description of the task - -### func \(\*InlineTask\) [Input]() - -```go -func (task *InlineTask) Input(key string, value interface{}) *InlineTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*InlineTask\) [InputMap]() - -```go -func (task *InlineTask) InputMap(inputMap map[string]interface{}) *InlineTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*InlineTask\) [Optional]() - -```go -func (task *InlineTask) Optional(optional bool) *InlineTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [JQTask]() - -```go -type JQTask struct { - Task -} -``` - -### func [NewJQTask]() - -```go -func NewJQTask(name string, script string) *JQTask -``` - -### func \(\*JQTask\) [Description]() - -```go -func (task *JQTask) Description(description string) *JQTask -``` - -Description of the task - -### func \(\*JQTask\) [Input]() - -```go -func (task *JQTask) Input(key string, value interface{}) *JQTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*JQTask\) [InputMap]() - -```go -func (task *JQTask) InputMap(inputMap map[string]interface{}) *JQTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*JQTask\) [Optional]() - -```go -func (task *JQTask) Optional(optional bool) *JQTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [JoinTask]() - -```go -type JoinTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewJoinTask]() - -```go -func NewJoinTask(taskRefName string, joinOn ...string) *JoinTask -``` - -### func \(\*JoinTask\) [Description]() - -```go -func (task *JoinTask) Description(description string) *JoinTask -``` - -Description of the task - -### func \(\*JoinTask\) [Optional]() - -```go -func (task *JoinTask) Optional(optional bool) *JoinTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [KafkaPublishTask]() - -```go -type KafkaPublishTask struct { - Task -} -``` - -### func [NewKafkaPublishTask]() - -```go -func NewKafkaPublishTask(taskRefName string, kafkaPublishTaskInput *KafkaPublishTaskInput) *KafkaPublishTask -``` - -### func \(\*KafkaPublishTask\) [Description]() - -```go -func (task *KafkaPublishTask) Description(description string) *KafkaPublishTask -``` - -Description of the task - -### func \(\*KafkaPublishTask\) [Input]() - -```go -func (task *KafkaPublishTask) Input(key string, value interface{}) *KafkaPublishTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*KafkaPublishTask\) [InputMap]() - -```go -func (task *KafkaPublishTask) InputMap(inputMap map[string]interface{}) *KafkaPublishTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*KafkaPublishTask\) [Optional]() - -```go -func (task *KafkaPublishTask) Optional(optional bool) *KafkaPublishTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [KafkaPublishTaskInput]() - -```go -type KafkaPublishTaskInput struct { - BootStrapServers string `json:"bootStrapServers"` - Key string `json:"key"` - KeySerializer string `json:"keySerializer,omitempty"` - Value string `json:"value"` - RequestTimeoutMs string `json:"requestTimeoutMs,omitempty"` - MaxBlockMs string `json:"maxBlockMs,omitempty"` - Headers map[string]interface{} `json:"headers,omitempty"` - Topic string `json:"topic"` -} -``` - -## type [SetVariableTask]() - -```go -type SetVariableTask struct { - Task -} -``` - -### func [NewSetVariableTask]() - -```go -func NewSetVariableTask(taskRefName string) *SetVariableTask -``` - -### func \(\*SetVariableTask\) [Description]() - -```go -func (task *SetVariableTask) Description(description string) *SetVariableTask -``` - -Description of the task - -### func \(\*SetVariableTask\) [Input]() - -```go -func (task *SetVariableTask) Input(key string, value interface{}) *SetVariableTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SetVariableTask\) [InputMap]() - -```go -func (task *SetVariableTask) InputMap(inputMap map[string]interface{}) *SetVariableTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SetVariableTask\) [Optional]() - -```go -func (task *SetVariableTask) Optional(optional bool) *SetVariableTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [SimpleTask]() - -```go -type SimpleTask struct { - Task -} -``` - -### func [NewSimpleTask]() - -```go -func NewSimpleTask(taskType string, taskRefName string) *SimpleTask -``` - -### func \(\*SimpleTask\) [Description]() - -```go -func (task *SimpleTask) Description(description string) *SimpleTask -``` - -Description of the task - -### func \(\*SimpleTask\) [Input]() - -```go -func (task *SimpleTask) Input(key string, value interface{}) *SimpleTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SimpleTask\) [InputMap]() - -```go -func (task *SimpleTask) InputMap(inputMap map[string]interface{}) *SimpleTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SimpleTask\) [Optional]() - -```go -func (task *SimpleTask) Optional(optional bool) *SimpleTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [StartWorkflowTask]() - -```go -type StartWorkflowTask struct { - Task -} -``` - -### func [NewStartWorkflowTask]() - -```go -func NewStartWorkflowTask(taskRefName string, workflowName string, version *int32, startWorkflowRequest *model.StartWorkflowRequest) *StartWorkflowTask -``` - -### func \(\*StartWorkflowTask\) [Description]() - -```go -func (task *StartWorkflowTask) Description(description string) *StartWorkflowTask -``` - -Description of the task - -### func \(\*StartWorkflowTask\) [Input]() - -```go -func (task *StartWorkflowTask) Input(key string, value interface{}) *StartWorkflowTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*StartWorkflowTask\) [InputMap]() - -```go -func (task *StartWorkflowTask) InputMap(inputMap map[string]interface{}) *StartWorkflowTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*StartWorkflowTask\) [Optional]() - -```go -func (task *StartWorkflowTask) Optional(optional bool) *StartWorkflowTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -## type [SubWorkflowTask]() - -```go -type SubWorkflowTask struct { - Task - // contains filtered or unexported fields -} -``` - -### func [NewSubWorkflowInlineTask]() - -```go -func NewSubWorkflowInlineTask(taskRefName string, workflow *ConductorWorkflow) *SubWorkflowTask -``` - -### func [NewSubWorkflowTask]() - -```go -func NewSubWorkflowTask(taskRefName string, workflowName string, version *int32) *SubWorkflowTask -``` - -### func \(\*SubWorkflowTask\) [Description]() - -```go -func (task *SubWorkflowTask) Description(description string) *SubWorkflowTask -``` - -Description of the task - -### func \(\*SubWorkflowTask\) [Input]() - -```go -func (task *SubWorkflowTask) Input(key string, value interface{}) *SubWorkflowTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SubWorkflowTask\) [InputMap]() - -```go -func (task *SubWorkflowTask) InputMap(inputMap map[string]interface{}) *SubWorkflowTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SubWorkflowTask\) [Optional]() - -```go -func (task *SubWorkflowTask) Optional(optional bool) *SubWorkflowTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -### func \(\*SubWorkflowTask\) [TaskToDomain]() - -```go -func (task *SubWorkflowTask) TaskToDomain(taskToDomainMap map[string]string) *SubWorkflowTask -``` - -## type [SwitchTask]() - -```go -type SwitchTask struct { - Task - DecisionCases map[string][]TaskInterface - // contains filtered or unexported fields -} -``` - -### func [NewSwitchTask]() - -```go -func NewSwitchTask(taskRefName string, caseExpression string) *SwitchTask -``` - -### func \(\*SwitchTask\) [DefaultCase]() - -```go -func (task *SwitchTask) DefaultCase(tasks ...TaskInterface) *SwitchTask -``` - -### func \(\*SwitchTask\) [Description]() - -```go -func (task *SwitchTask) Description(description string) *SwitchTask -``` - -Description of the task - -### func \(\*SwitchTask\) [Input]() - -```go -func (task *SwitchTask) Input(key string, value interface{}) *SwitchTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SwitchTask\) [InputMap]() - -```go -func (task *SwitchTask) InputMap(inputMap map[string]interface{}) *SwitchTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*SwitchTask\) [Optional]() - -```go -func (task *SwitchTask) Optional(optional bool) *SwitchTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -### func \(\*SwitchTask\) [SwitchCase]() - -```go -func (task *SwitchTask) SwitchCase(caseName string, tasks ...TaskInterface) *SwitchTask -``` - -### func \(\*SwitchTask\) [UseJavascript]() - -```go -func (task *SwitchTask) UseJavascript(use bool) *SwitchTask -``` - -UseJavascript If set to to true\, the caseExpression parameter is treated as a Javascript\. If set to false\, the caseExpression follows the regular task input mapping format as described in https://conductor.netflix.com/how-tos/Tasks/task-inputs.html - -## type [Task]() - -```go -type Task struct { - // contains filtered or unexported fields -} -``` - -### func \(\*Task\) [Description]() - -```go -func (task *Task) Description(description string) *Task -``` - -Description of the task - -### func \(\*Task\) [Input]() - -```go -func (task *Task) Input(key string, value interface{}) *Task -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*Task\) [InputMap]() - -```go -func (task *Task) InputMap(inputMap map[string]interface{}) *Task -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*Task\) [Optional]() - -```go -func (task *Task) Optional(optional bool) *Task -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - -### func \(\*Task\) [OutputRef]() - -```go -func (task *Task) OutputRef(path string) string -``` - -### func \(\*Task\) [ReferenceName]() - -```go -func (task *Task) ReferenceName() string -``` - -### func \(\*Task\) [ToTaskDef]() - -```go -func (task *Task) ToTaskDef() *model.TaskDef -``` - -## type [TaskInterface]() - -```go -type TaskInterface interface { - OutputRef(path string) string - ToTaskDef() *model.TaskDef - // contains filtered or unexported methods -} -``` - -## type [TaskType]() - -```go -type TaskType string -``` - -```go -const ( - SIMPLE TaskType = "SIMPLE" - DYNAMIC TaskType = "DYNAMIC" - FORK_JOIN TaskType = "FORK_JOIN" - FORK_JOIN_DYNAMIC TaskType = "FORK_JOIN_DYNAMIC" - SWITCH TaskType = "SWITCH" - JOIN TaskType = "JOIN" - DO_WHILE TaskType = "DO_WHILE" - SUB_WORKFLOW TaskType = "SUB_WORKFLOW" - START_WORKFLOW TaskType = "START_WORKFLOW" - EVENT TaskType = "EVENT" - WAIT TaskType = "WAIT" - HUMAN TaskType = "HUMAN" - HTTP TaskType = "HTTP" - INLINE TaskType = "INLINE" - TERMINATE TaskType = "TERMINATE" - KAFKA_PUBLISH TaskType = "KAFKA_PUBLISH" - JSON_JQ_TRANSFORM TaskType = "JSON_JQ_TRANSFORM" - SET_VARIABLE TaskType = "SET_VARIABLE" -) -``` - -## type [TerminateTask]() - -```go -type TerminateTask struct { - Task -} -``` - -### func [NewTerminateTask]() - -```go -func NewTerminateTask(taskRefName string, status model.WorkflowStatus, terminationReason string) *TerminateTask -``` - -### func \(\*TerminateTask\) [Description]() - -```go -func (task *TerminateTask) Description(description string) *TerminateTask -``` - -Description of the task - -### func \(\*TerminateTask\) [Input]() - -```go -func (task *TerminateTask) Input(key string, value interface{}) *TerminateTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*TerminateTask\) [InputMap]() - -```go -func (task *TerminateTask) InputMap(inputMap map[string]interface{}) *TerminateTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -## type [TimeoutPolicy]() - -```go -type TimeoutPolicy string -``` - -```go -const ( - TimeOutWorkflow TimeoutPolicy = "TIME_OUT_WF" - AlertOnly TimeoutPolicy = "ALERT_ONLY" -) -``` - -## type [WaitTask]() - -```go -type WaitTask struct { - Task -} -``` - -### func [NewWaitForDurationTask]() - -```go -func NewWaitForDurationTask(taskRefName string, duration time.Duration) *WaitTask -``` - -### func [NewWaitTask]() - -```go -func NewWaitTask(taskRefName string) *WaitTask -``` - -NewWaitTask creates WAIT task used to wait until an external event or a timeout occurs - -### func [NewWaitUntilTask]() - -```go -func NewWaitUntilTask(taskRefName string, dateTime string) *WaitTask -``` - -### func \(\*WaitTask\) [Description]() - -```go -func (task *WaitTask) Description(description string) *WaitTask -``` - -Description of the task - -### func \(\*WaitTask\) [Input]() - -```go -func (task *WaitTask) Input(key string, value interface{}) *WaitTask -``` - -Input to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*WaitTask\) [InputMap]() - -```go -func (task *WaitTask) InputMap(inputMap map[string]interface{}) *WaitTask -``` - -InputMap to the task\. See https://conductor.netflix.com/how-tos/Tasks/task-inputs.html for details - -### func \(\*WaitTask\) [Optional]() - -```go -func (task *WaitTask) Optional(optional bool) *WaitTask -``` - -Optional if set to true\, the task will not fail the workflow if the task fails - - - -Generated by [gomarkdoc]() diff --git a/examples/go.mod b/examples/go.mod new file mode 100644 index 00000000..81b7b712 --- /dev/null +++ b/examples/go.mod @@ -0,0 +1,25 @@ +module examples + +go 1.17 + +require ( + github.com/conductor-sdk/conductor-go v0.0.0 + github.com/sirupsen/logrus v1.9.3 +) + +replace github.com/conductor-sdk/conductor-go => ../ + +require ( + github.com/antihax/optional v1.0.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + golang.org/x/sys v0.6.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect +) diff --git a/examples/hello_world/main.go b/examples/hello_world/main.go new file mode 100644 index 00000000..e6450f04 --- /dev/null +++ b/examples/hello_world/main.go @@ -0,0 +1,85 @@ +package main + +import ( + hello_world "examples/hello_world/src" + "os" + "time" + + log "github.com/sirupsen/logrus" + + "github.com/conductor-sdk/conductor-go/sdk/client" + "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/sdk/settings" + + "github.com/conductor-sdk/conductor-go/sdk/worker" + "github.com/conductor-sdk/conductor-go/sdk/workflow/executor" +) + +var ( + apiClient = client.NewAPIClient( + authSettings(), + httpSettings(), + ) + taskRunner = worker.NewTaskRunnerWithApiClient(apiClient) + workflowExecutor = executor.NewWorkflowExecutor(apiClient) +) + +func authSettings() *settings.AuthenticationSettings { + key := os.Getenv("KEY") + secret := os.Getenv("SECRET") + if key != "" && secret != "" { + return settings.NewAuthenticationSettings( + key, + secret, + ) + } + + return nil +} + +func httpSettings() *settings.HttpSettings { + url := os.Getenv("CONDUCTOR_SERVER_URL") + if url == "" { + log.Error("Error: CONDUCTOR_SERVER_URL env variable is not set") + os.Exit(1) + } + + return settings.NewHttpSettings(url) +} + +func main() { + // Start the Greet Worker. This worker will process "greet" tasks. + taskRunner.StartWorker("greet", hello_world.Greet, 1, time.Millisecond*100) + + // This is used to register the Workflow, it's a one-time process. You can comment from here + wf := hello_world.CreateWorkflow(workflowExecutor) + err := wf.Register(true) + if err != nil { + log.Error(err.Error()) + return + } + // Till Here after registering the workflow + + // Start the greetings workflow + id, err := workflowExecutor.StartWorkflow( + &model.StartWorkflowRequest{ + Name: "greetings", + Version: 1, + Input: map[string]string{ + "name": "Gopher", + }, + }, + ) + + if err != nil { + log.Error(err.Error()) + return + } + log.Info("Started workflow with Id: ", id) + + // Get a channel to monitor the workflow execution - + // Note: This is useful in case of short duration workflows that completes in few seconds. + channel, _ := workflowExecutor.MonitorExecution(id) + run := <-channel + log.Info("Output of the workflow: ", run.Output) +} diff --git a/examples/hello_world/src/worker.go b/examples/hello_world/src/worker.go new file mode 100644 index 00000000..9ac38775 --- /dev/null +++ b/examples/hello_world/src/worker.go @@ -0,0 +1,14 @@ +// Hello World Application Using Conductor +package hello_world + +import ( + "fmt" + + "github.com/conductor-sdk/conductor-go/sdk/model" +) + +func Greet(task *model.Task) (interface{}, error) { + return map[string]interface{}{ + "greetings": "Hello, " + fmt.Sprintf("%v", task.InputData["name"]), + }, nil +} diff --git a/examples/hello_world/src/workflow.go b/examples/hello_world/src/workflow.go new file mode 100644 index 00000000..91e5cec8 --- /dev/null +++ b/examples/hello_world/src/workflow.go @@ -0,0 +1,30 @@ +// Hello World Application Using Conductor +package hello_world + +import ( + "github.com/conductor-sdk/conductor-go/sdk/workflow" + "github.com/conductor-sdk/conductor-go/sdk/workflow/executor" +) + +// Creates the "greetings" workflow definition. +func CreateWorkflow(executor *executor.WorkflowExecutor) *workflow.ConductorWorkflow { + wf := workflow.NewConductorWorkflow(executor). + Name("greetings"). + Version(1). + Description("Greetings workflow - Greets a user by their name"). + TimeoutPolicy(workflow.TimeOutWorkflow, 600) + + //New Simple Task - "greet" Task + greet := workflow.NewSimpleTask("greet", "greet_ref"). + Input("name", "${workflow.input.name}") + + //Add task to workflow + wf.Add(greet) + + //Add the output of the workflow from the task + wf.OutputParameters(map[string]interface{}{ + "Greetings": greet.OutputRef("greetings"), + }) + + return wf +} diff --git a/sdk/client/api_application_resource.go b/sdk/client/api_application_resource.go index 1492e3aa..076c7dfe 100644 --- a/sdk/client/api_application_resource.go +++ b/sdk/client/api_application_resource.go @@ -6,16 +6,18 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" "net/url" "strings" + + "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type ApplicationResourceApiService struct { diff --git a/sdk/client/api_authorization_resource.go b/sdk/client/api_authorization_resource.go index c897d562..b3f67e50 100644 --- a/sdk/client/api_authorization_resource.go +++ b/sdk/client/api_authorization_resource.go @@ -6,15 +6,17 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" "net/url" "strings" + + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type AuthorizationResourceApiService struct { diff --git a/sdk/client/api_environment_resource.go b/sdk/client/api_environment_resource.go index 3850a17f..0650329f 100644 --- a/sdk/client/api_environment_resource.go +++ b/sdk/client/api_environment_resource.go @@ -6,15 +6,17 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" "net/url" "strings" + "github.com/conductor-sdk/conductor-go/sdk/model" + "fmt" ) diff --git a/sdk/client/api_event_resource.go b/sdk/client/api_event_resource.go index 72f2356f..6cd5e7b7 100644 --- a/sdk/client/api_event_resource.go +++ b/sdk/client/api_event_resource.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( diff --git a/sdk/client/api_group_resource.go b/sdk/client/api_group_resource.go index 0d38412e..3f70f489 100644 --- a/sdk/client/api_group_resource.go +++ b/sdk/client/api_group_resource.go @@ -6,15 +6,17 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" "net/url" "strings" + + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type GroupResourceApiService struct { diff --git a/sdk/client/api_human_task.go b/sdk/client/api_human_task.go index c3d0577a..b3501869 100644 --- a/sdk/client/api_human_task.go +++ b/sdk/client/api_human_task.go @@ -6,16 +6,18 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/sdk/model/human" "net/http" "net/url" "strings" + + "github.com/antihax/optional" + "github.com/conductor-sdk/conductor-go/sdk/model/human" ) type HumanTaskApiService struct { diff --git a/sdk/client/api_integration_resource.go b/sdk/client/api_integration_resource.go index 1f401be0..7e85d9f4 100644 --- a/sdk/client/api_integration_resource.go +++ b/sdk/client/api_integration_resource.go @@ -1,14 +1,24 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/sdk/model" - "github.com/conductor-sdk/conductor-go/sdk/model/integration" "net/http" "net/url" "strings" + + "github.com/antihax/optional" + "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/sdk/model/integration" ) type IntegrationResourceApiService struct { diff --git a/sdk/client/api_prompt_resource.go b/sdk/client/api_prompt_resource.go index 0c603a69..91b1db23 100644 --- a/sdk/client/api_prompt_resource.go +++ b/sdk/client/api_prompt_resource.go @@ -6,16 +6,18 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model" - "github.com/conductor-sdk/conductor-go/sdk/model/integration" "net/http" "net/url" "strings" + + "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/sdk/model/integration" ) type PromptResourceApiService struct { diff --git a/sdk/client/api_scheduler_resource.go b/sdk/client/api_scheduler_resource.go index 58264f21..e45b00ce 100644 --- a/sdk/client/api_scheduler_resource.go +++ b/sdk/client/api_scheduler_resource.go @@ -6,16 +6,18 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" "net/url" "strings" + + "github.com/antihax/optional" + "github.com/conductor-sdk/conductor-go/sdk/model" ) type SchedulerResourceApiService struct { diff --git a/sdk/client/api_secret_resource.go b/sdk/client/api_secret_resource.go index 58fdf893..3a48ca01 100644 --- a/sdk/client/api_secret_resource.go +++ b/sdk/client/api_secret_resource.go @@ -6,15 +6,17 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" "net/url" "strings" + + "github.com/conductor-sdk/conductor-go/sdk/model" ) type SecretResourceApiService struct { diff --git a/sdk/client/api_tags_resource.go b/sdk/client/api_tags_resource.go index 32aabc7f..97f7bace 100644 --- a/sdk/client/api_tags_resource.go +++ b/sdk/client/api_tags_resource.go @@ -1,3 +1,12 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( diff --git a/sdk/client/api_user_resource.go b/sdk/client/api_user_resource.go index 6e16e041..46ddbf5e 100644 --- a/sdk/client/api_user_resource.go +++ b/sdk/client/api_user_resource.go @@ -6,16 +6,18 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" - "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" "net/url" "strings" + + "github.com/antihax/optional" + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type UserResourceApiService struct { diff --git a/sdk/client/api_webhooks_config_resource.go b/sdk/client/api_webhooks_config_resource.go index 2fe68feb..681512dd 100644 --- a/sdk/client/api_webhooks_config_resource.go +++ b/sdk/client/api_webhooks_config_resource.go @@ -6,11 +6,13 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package client import ( "context" "fmt" + "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" diff --git a/sdk/client/application_client.go b/sdk/client/application_client.go index b4af9e4b..e2d423f5 100644 --- a/sdk/client/application_client.go +++ b/sdk/client/application_client.go @@ -1,10 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" + "net/http" + "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/model/rbac" - "net/http" ) type ApplicationClient interface { diff --git a/sdk/client/authorization_client.go b/sdk/client/authorization_client.go index 8420df4f..1a0acec0 100644 --- a/sdk/client/authorization_client.go +++ b/sdk/client/authorization_client.go @@ -1,9 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" + + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type AuthorizationClient interface { diff --git a/sdk/client/doc.go b/sdk/client/doc.go new file mode 100644 index 00000000..03a3b564 --- /dev/null +++ b/sdk/client/doc.go @@ -0,0 +1,4 @@ +/* +This package contains the API client for Conductor. +*/ +package client diff --git a/sdk/client/environment_client.go b/sdk/client/environment_client.go index 013a7c37..ce048d2c 100644 --- a/sdk/client/environment_client.go +++ b/sdk/client/environment_client.go @@ -1,9 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" + + "github.com/conductor-sdk/conductor-go/sdk/model" ) type EnvironmentClient interface { diff --git a/sdk/client/event_client.go b/sdk/client/event_client.go index ae2dc3dd..3a50bde7 100644 --- a/sdk/client/event_client.go +++ b/sdk/client/event_client.go @@ -1,9 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model" "net/http" + + "github.com/conductor-sdk/conductor-go/sdk/model" ) type EventHandlerClient interface { diff --git a/sdk/client/group_client.go b/sdk/client/group_client.go index fe5d2f29..fbdda7bd 100644 --- a/sdk/client/group_client.go +++ b/sdk/client/group_client.go @@ -1,9 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model/rbac" "net/http" + + "github.com/conductor-sdk/conductor-go/sdk/model/rbac" ) type GroupClient interface { diff --git a/sdk/client/human_task_client.go b/sdk/client/human_task_client.go index d3539a35..3b31fbbe 100644 --- a/sdk/client/human_task_client.go +++ b/sdk/client/human_task_client.go @@ -1,9 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + package client import ( "context" - "github.com/conductor-sdk/conductor-go/sdk/model/human" "net/http" + + "github.com/conductor-sdk/conductor-go/sdk/model/human" ) type HumanTaskClient interface { diff --git a/sdk/model/environment_variable.go b/sdk/model/environment_variable.go index ad476715..906d434d 100644 --- a/sdk/model/environment_variable.go +++ b/sdk/model/environment_variable.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type EnvironmentVariable struct { diff --git a/sdk/model/human/human_task_assignment.go b/sdk/model/human/human_task_assignment.go index df0b1d21..52c651f6 100644 --- a/sdk/model/human/human_task_assignment.go +++ b/sdk/model/human/human_task_assignment.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskAssignment struct { diff --git a/sdk/model/human/human_task_definition.go b/sdk/model/human/human_task_definition.go index 6d3e1c10..1ece4b85 100644 --- a/sdk/model/human/human_task_definition.go +++ b/sdk/model/human/human_task_definition.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskDefinition struct { diff --git a/sdk/model/human/human_task_entry.go b/sdk/model/human/human_task_entry.go index 2584f596..c36d588b 100644 --- a/sdk/model/human/human_task_entry.go +++ b/sdk/model/human/human_task_entry.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskEntry struct { diff --git a/sdk/model/human/human_task_search.go b/sdk/model/human/human_task_search.go index 914a3829..27efeba5 100644 --- a/sdk/model/human/human_task_search.go +++ b/sdk/model/human/human_task_search.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskSearch struct { diff --git a/sdk/model/human/human_task_search_result.go b/sdk/model/human/human_task_search_result.go index 11bb4b4d..fe520bea 100644 --- a/sdk/model/human/human_task_search_result.go +++ b/sdk/model/human/human_task_search_result.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskSearchResult struct { diff --git a/sdk/model/human/human_task_template.go b/sdk/model/human/human_task_template.go index 70f2f98f..7dea7f04 100644 --- a/sdk/model/human/human_task_template.go +++ b/sdk/model/human/human_task_template.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human import "github.com/conductor-sdk/conductor-go/sdk/model" diff --git a/sdk/model/human/human_task_trigger.go b/sdk/model/human/human_task_trigger.go index 9e5cdb2f..bfd41ed0 100644 --- a/sdk/model/human/human_task_trigger.go +++ b/sdk/model/human/human_task_trigger.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human import "github.com/conductor-sdk/conductor-go/sdk/model" diff --git a/sdk/model/human/human_task_user.go b/sdk/model/human/human_task_user.go index 2ec73d22..0a0d428c 100644 --- a/sdk/model/human/human_task_user.go +++ b/sdk/model/human/human_task_user.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type HumanTaskUser struct { diff --git a/sdk/model/human/user_form_template.go b/sdk/model/human/user_form_template.go index 41b64541..e2822463 100644 --- a/sdk/model/human/user_form_template.go +++ b/sdk/model/human/user_form_template.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package human type UserFormTemplate struct { diff --git a/sdk/model/prompt_template_test_request.go b/sdk/model/prompt_template_test_request.go index d274a3d6..0f9bd653 100644 --- a/sdk/model/prompt_template_test_request.go +++ b/sdk/model/prompt_template_test_request.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type PromptTemplateTestRequest struct { diff --git a/sdk/model/rbac/access_key_response.go b/sdk/model/rbac/access_key_response.go index 5f19bc91..d6f53adc 100644 --- a/sdk/model/rbac/access_key_response.go +++ b/sdk/model/rbac/access_key_response.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type AccessKeyResponse struct { diff --git a/sdk/model/rbac/authorization_request.go b/sdk/model/rbac/authorization_request.go index af24f0b3..938134a3 100644 --- a/sdk/model/rbac/authorization_request.go +++ b/sdk/model/rbac/authorization_request.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type AuthorizationRequest struct { diff --git a/sdk/model/rbac/conductor_user.go b/sdk/model/rbac/conductor_user.go index b94f0d6d..74d67331 100644 --- a/sdk/model/rbac/conductor_user.go +++ b/sdk/model/rbac/conductor_user.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type ConductorUser struct { diff --git a/sdk/model/rbac/create_or_update_application_request.go b/sdk/model/rbac/create_or_update_application_request.go index 5bee558a..82a9ab90 100644 --- a/sdk/model/rbac/create_or_update_application_request.go +++ b/sdk/model/rbac/create_or_update_application_request.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type CreateOrUpdateApplicationRequest struct { diff --git a/sdk/model/rbac/extended_conductor_application.go b/sdk/model/rbac/extended_conductor_application.go index a8f53b15..b0d846ce 100644 --- a/sdk/model/rbac/extended_conductor_application.go +++ b/sdk/model/rbac/extended_conductor_application.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac import "github.com/conductor-sdk/conductor-go/sdk/model" diff --git a/sdk/model/rbac/granted_access.go b/sdk/model/rbac/granted_access.go index 2b139a62..3393763f 100644 --- a/sdk/model/rbac/granted_access.go +++ b/sdk/model/rbac/granted_access.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type GrantedAccess struct { diff --git a/sdk/model/rbac/granted_access_response.go b/sdk/model/rbac/granted_access_response.go index 00c7dede..80c081cc 100644 --- a/sdk/model/rbac/granted_access_response.go +++ b/sdk/model/rbac/granted_access_response.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type GrantedAccessResponse struct { diff --git a/sdk/model/rbac/group.go b/sdk/model/rbac/group.go index 1934b6e7..34cafbc3 100644 --- a/sdk/model/rbac/group.go +++ b/sdk/model/rbac/group.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type Group struct { diff --git a/sdk/model/rbac/permission.go b/sdk/model/rbac/permission.go index 45076cda..647fa204 100644 --- a/sdk/model/rbac/permission.go +++ b/sdk/model/rbac/permission.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type Permission struct { diff --git a/sdk/model/rbac/role.go b/sdk/model/rbac/role.go index 1122b57a..c9fc2cdd 100644 --- a/sdk/model/rbac/role.go +++ b/sdk/model/rbac/role.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type Role struct { diff --git a/sdk/model/rbac/subject_ref.go b/sdk/model/rbac/subject_ref.go index 15acb4bf..2215c207 100644 --- a/sdk/model/rbac/subject_ref.go +++ b/sdk/model/rbac/subject_ref.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac // User, group or role which is granted/removed access diff --git a/sdk/model/rbac/target_ref.go b/sdk/model/rbac/target_ref.go index d3223f06..65ca6200 100644 --- a/sdk/model/rbac/target_ref.go +++ b/sdk/model/rbac/target_ref.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac // The object over which access is being granted or removed diff --git a/sdk/model/rbac/upsert_group_request.go b/sdk/model/rbac/upsert_group_request.go index 1d6832eb..84d7084a 100644 --- a/sdk/model/rbac/upsert_group_request.go +++ b/sdk/model/rbac/upsert_group_request.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type UpsertGroupRequest struct { diff --git a/sdk/model/rbac/upsert_user_request.go b/sdk/model/rbac/upsert_user_request.go index 9ace6a14..c318ba6b 100644 --- a/sdk/model/rbac/upsert_user_request.go +++ b/sdk/model/rbac/upsert_user_request.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package rbac type UpsertUserRequest struct { diff --git a/sdk/model/search_result_workflow_schedule_execution_model.go b/sdk/model/search_result_workflow_schedule_execution_model.go index de5e8524..f8124fff 100644 --- a/sdk/model/search_result_workflow_schedule_execution_model.go +++ b/sdk/model/search_result_workflow_schedule_execution_model.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type SearchResultWorkflowSchedule struct { diff --git a/sdk/model/secret.go b/sdk/model/secret.go index 03536204..f06aeb16 100644 --- a/sdk/model/secret.go +++ b/sdk/model/secret.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type Secret struct { diff --git a/sdk/model/state_change_event.go b/sdk/model/state_change_event.go index 78d3374a..aa9aad5f 100644 --- a/sdk/model/state_change_event.go +++ b/sdk/model/state_change_event.go @@ -6,6 +6,7 @@ * API version: v2 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package model type StateChangeEvent struct { diff --git a/sdk/model/tag_object.go b/sdk/model/tag_object.go index cc4a19f7..9537bf71 100644 --- a/sdk/model/tag_object.go +++ b/sdk/model/tag_object.go @@ -6,6 +6,7 @@ * API version: v2 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package model type TagObject struct { diff --git a/sdk/model/tag_string.go b/sdk/model/tag_string.go index 46290cc3..2ebb4a4c 100644 --- a/sdk/model/tag_string.go +++ b/sdk/model/tag_string.go @@ -6,6 +6,7 @@ * API version: v2 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ + package model type TagString struct { diff --git a/sdk/model/workflow_schedule.go b/sdk/model/workflow_schedule.go index ec94cc59..17cd2454 100644 --- a/sdk/model/workflow_schedule.go +++ b/sdk/model/workflow_schedule.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type WorkflowSchedule struct { diff --git a/sdk/model/workflow_schedule_execution_model.go b/sdk/model/workflow_schedule_execution_model.go index 0077958e..c167dcdb 100644 --- a/sdk/model/workflow_schedule_execution_model.go +++ b/sdk/model/workflow_schedule_execution_model.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type WorkflowScheduleExecutionModel struct { diff --git a/sdk/model/workflow_schedule_model.go b/sdk/model/workflow_schedule_model.go index 0049e1b5..6fb346a0 100644 --- a/sdk/model/workflow_schedule_model.go +++ b/sdk/model/workflow_schedule_model.go @@ -6,6 +6,7 @@ // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + package model type WorkflowScheduleModel struct { diff --git a/sdk/workflow/workflow.go b/sdk/workflow/workflow.go index 35d31c84..6e68cad8 100644 --- a/sdk/workflow/workflow.go +++ b/sdk/workflow/workflow.go @@ -163,8 +163,8 @@ func (workflow *ConductorWorkflow) UnRegister() error { return workflow.executor.UnRegisterWorkflow(workflow.name, workflow.version) } -// StartWorkflowWithInput ExecuteWorkflowWithInput Execute the workflow with specific input. The input struct MUST be serializable to JSON -// Returns the workflow Id that can be used to monitor and get the status of the workflow execution +// Start the workflow with specific input. The input struct MUST be serializable to JSON +// Returns the workflow Id that can be used to monitor and get the status of the workflow execution. func (workflow *ConductorWorkflow) StartWorkflowWithInput(input interface{}) (workflowId string, err error) { version := workflow.GetVersion() return workflow.executor.StartWorkflow( @@ -184,7 +184,7 @@ func (workflow *ConductorWorkflow) StartWorkflow(startWorkflowRequest *model.Sta return workflow.executor.StartWorkflow(startWorkflowRequest) } -// ExecuteWorkflowWithInput Execute the workflow with specific input and wait for the workflow to complete or until the task specified as waitUntil is completed. +// Executes the workflow with specific input and wait for the workflow to complete or until the task specified as waitUntil is completed. // waitUntilTask Reference name of the task which MUST be completed before returning the output. if specified as empty string, then the call waits until the // workflow completes or reaches the timeout (as specified on the server) // The input struct MUST be serializable to JSON diff --git a/test/common/common.go b/test/common/common.go deleted file mode 100644 index fc999db8..00000000 --- a/test/common/common.go +++ /dev/null @@ -1,76 +0,0 @@ -package common - -import ( - "time" - - "github.com/conductor-sdk/conductor-go/sdk/model" - "github.com/conductor-sdk/conductor-go/sdk/workflow" -) - -const ( - WorkflowValidationTimeout = 7 * time.Second - WorkflowBulkQty = 10 -) - -var ( - TestHttpTask = workflow.NewHttpTask( - "TEST_GO_TASK_HTTP", - &workflow.HttpInput{ - Uri: "https://orkes-api-tester.orkesconductor.com/get", - }, - ) - - TestSimpleTask = workflow.NewSimpleTask( - "TEST_GO_TASK_SIMPLE", "TEST_GO_TASK_SIMPLE", - ) - - TestTerminateTask = workflow.NewTerminateTask( - "TEST_GO_TASK_TERMINATE", - model.FailedWorkflow, - "Task used to mark workflow as failed", - ) - - TestSwitchTask = workflow.NewSwitchTask( - "TEST_GO_TASK_SWITCH", - "switchCaseValue", - ). - Input("switchCaseValue", "${workflow.input.service}"). - UseJavascript(true). - SwitchCase( - "REQUEST", - TestHttpTask, - ). - SwitchCase( - "STOP", - TestTerminateTask, - ) - - TestInlineTask = workflow.NewInlineTask( - "TEST_GO_TASK_INLINE", - "function e() { if ($.value == 1){return {\"result\": true}} else { return {\"result\": false}}} e();", - ) - - TestKafkaPublishTask = workflow.NewKafkaPublishTask( - "TEST_GO_TASK_KAFKA_PUBLISH", - &workflow.KafkaPublishTaskInput{ - Topic: "userTopic", - Value: "Message to publish", - BootStrapServers: "localhost:9092", - Headers: map[string]interface{}{ - "x-Auth": "Auth-key", - }, - Key: "123", - KeySerializer: "org.apache.kafka.common.serialization.IntegerSerializer", - }, - ) - - TestSqsEventTask = workflow.NewSqsEventTask( - "TEST_GO_TASK_EVENT_SQS", - "QUEUE", - ) - - TestConductorEventTask = workflow.NewConductorEventTask( - "TEST_GO_TASK_EVENT_CONDUCTOR", - "EVENT_NAME", - ) -) diff --git a/test/integration_tests/application_client_test.go b/test/integration_tests/application_client_test.go index 64854e9b..10f28ae9 100644 --- a/test/integration_tests/application_client_test.go +++ b/test/integration_tests/application_client_test.go @@ -2,11 +2,13 @@ package integration_tests import ( "context" - "github.com/conductor-sdk/conductor-go/internal/testdata" + + "testing" + "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/model/rbac" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" - "testing" ) func TestApplicationLifecycle(t *testing.T) { diff --git a/test/integration_tests/env_client_test.go b/test/integration_tests/env_client_test.go index 20ffdab8..ea1bdf08 100644 --- a/test/integration_tests/env_client_test.go +++ b/test/integration_tests/env_client_test.go @@ -2,12 +2,13 @@ package integration_tests import ( "context" - "github.com/conductor-sdk/conductor-go/internal/testdata" + "net/http" + "testing" + "github.com/conductor-sdk/conductor-go/sdk/client" "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func TestCreateOrUpdateEnvVariable(t *testing.T) { diff --git a/test/integration_tests/integration_client_test.go b/test/integration_tests/integration_client_test.go index e0a6c7c8..128d0ebb 100644 --- a/test/integration_tests/integration_client_test.go +++ b/test/integration_tests/integration_client_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/client" "github.com/conductor-sdk/conductor-go/sdk/model/integration" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/require" ) diff --git a/test/integration_tests/metadata_resource_test.go b/test/integration_tests/metadata_resource_test.go index 48de0791..e0ed02ec 100644 --- a/test/integration_tests/metadata_resource_test.go +++ b/test/integration_tests/metadata_resource_test.go @@ -13,8 +13,8 @@ import ( "context" "testing" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" ) diff --git a/test/integration_tests/task_resource_test.go b/test/integration_tests/task_resource_test.go index c99c533c..6f076277 100644 --- a/test/integration_tests/task_resource_test.go +++ b/test/integration_tests/task_resource_test.go @@ -14,17 +14,16 @@ import ( "testing" "time" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/test/common" + "github.com/conductor-sdk/conductor-go/test/testdata" ) func TestUpdateTaskRefByName(t *testing.T) { simpleTaskWorkflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_UPDATE_TASK"). Version(1). - Add(common.TestSimpleTask) + Add(testdata.TestSimpleTask) err := testdata.ValidateWorkflowRegistration(simpleTaskWorkflow) diff --git a/test/integration_tests/user_client_test.go b/test/integration_tests/user_client_test.go index 33a7f0a3..62dad7fd 100644 --- a/test/integration_tests/user_client_test.go +++ b/test/integration_tests/user_client_test.go @@ -2,13 +2,14 @@ package integration_tests import ( "context" + "net/http" + "testing" + "github.com/antihax/optional" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/client" "github.com/conductor-sdk/conductor-go/sdk/model/rbac" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" - "net/http" - "testing" ) // TestCheckPermissions checks if permissions for a user can be retrieved correctly. diff --git a/test/integration_tests/worker_test.go b/test/integration_tests/worker_test.go index 05126913..a83da7e2 100644 --- a/test/integration_tests/worker_test.go +++ b/test/integration_tests/worker_test.go @@ -13,10 +13,9 @@ import ( "testing" "time" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/test/common" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/sirupsen/logrus" ) @@ -24,9 +23,9 @@ func TestWorkerBatchSize(t *testing.T) { simpleTaskWorkflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_SIMPLE"). Version(1). - Add(common.TestSimpleTask) + Add(testdata.TestSimpleTask) err := testdata.TaskRunner.StartWorker( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), testdata.SimpleWorker, 5, testdata.WorkerPollInterval, @@ -35,36 +34,36 @@ func TestWorkerBatchSize(t *testing.T) { t.Fatal(err) } time.Sleep(1 * time.Second) - if testdata.TaskRunner.GetBatchSizeForTask(common.TestSimpleTask.ReferenceName()) != 5 { + if testdata.TaskRunner.GetBatchSizeForTask(testdata.TestSimpleTask.ReferenceName()) != 5 { t.Fatal("unexpected batch size") } - err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } err = testdata.TaskRunner.SetBatchSize( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), 0, ) if err != nil { t.Fatal(err) } time.Sleep(1 * time.Second) - if testdata.TaskRunner.GetBatchSizeForTask(common.TestSimpleTask.ReferenceName()) != 0 { + if testdata.TaskRunner.GetBatchSizeForTask(testdata.TestSimpleTask.ReferenceName()) != 0 { t.Fatal("unexpected batch size") } err = testdata.TaskRunner.SetBatchSize( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), 8, ) if err != nil { t.Fatal(err) } time.Sleep(1 * time.Second) - if testdata.TaskRunner.GetBatchSizeForTask(common.TestSimpleTask.ReferenceName()) != 8 { + if testdata.TaskRunner.GetBatchSizeForTask(testdata.TestSimpleTask.ReferenceName()) != 8 { t.Fatal("unexpected batch size") } - err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } diff --git a/test/integration_tests/workflow_def_test.go b/test/integration_tests/workflow_def_test.go index 008b9131..df015088 100644 --- a/test/integration_tests/workflow_def_test.go +++ b/test/integration_tests/workflow_def_test.go @@ -14,10 +14,9 @@ import ( "os" "testing" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/test/common" + "github.com/conductor-sdk/conductor-go/test/testdata" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" ) @@ -34,12 +33,12 @@ func TestHttpTask(t *testing.T) { OwnerEmail("test@orkes.io"). Version(1). WorkflowStatusListenerEnabled(true). - Add(common.TestHttpTask) - err := testdata.ValidateWorkflow(httpTaskWorkflow, common.WorkflowValidationTimeout, model.CompletedWorkflow) + Add(testdata.TestHttpTask) + err := testdata.ValidateWorkflow(httpTaskWorkflow, testdata.WorkflowValidationTimeout, model.CompletedWorkflow) if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflowBulk(httpTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(httpTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } @@ -53,16 +52,16 @@ func TestHttpTask(t *testing.T) { } func SimpleTask(t *testing.T) { - err := testdata.ValidateTaskRegistration(*common.TestSimpleTask.ToTaskDef()) + err := testdata.ValidateTaskRegistration(*testdata.TestSimpleTask.ToTaskDef()) if err != nil { t.Fatal(err) } simpleTaskWorkflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_SIMPLE"). Version(1). - Add(common.TestSimpleTask) + Add(testdata.TestSimpleTask) err = testdata.TaskRunner.StartWorker( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), testdata.SimpleWorker, testdata.WorkerQty, testdata.WorkerPollInterval, @@ -70,16 +69,16 @@ func SimpleTask(t *testing.T) { if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflow(simpleTaskWorkflow, common.WorkflowValidationTimeout, model.CompletedWorkflow) + err = testdata.ValidateWorkflow(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, model.CompletedWorkflow) if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } err = testdata.TaskRunner.DecreaseBatchSize( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), testdata.WorkerQty, ) if err != nil { @@ -95,7 +94,7 @@ func SimpleTask(t *testing.T) { } func SimpleTaskWithoutRetryCount(t *testing.T) { - taskToRegister := common.TestSimpleTask.ToTaskDef() + taskToRegister := testdata.TestSimpleTask.ToTaskDef() taskToRegister.RetryCount = 0 err := testdata.ValidateTaskRegistration(*taskToRegister) if err != nil { @@ -104,9 +103,9 @@ func SimpleTaskWithoutRetryCount(t *testing.T) { simpleTaskWorkflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_SIMPLE"). Version(1). - Add(common.TestSimpleTask) + Add(testdata.TestSimpleTask) err = testdata.TaskRunner.StartWorker( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), testdata.SimpleWorker, testdata.WorkerQty, testdata.WorkerPollInterval, @@ -114,16 +113,16 @@ func SimpleTaskWithoutRetryCount(t *testing.T) { if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflow(simpleTaskWorkflow, common.WorkflowValidationTimeout, model.CompletedWorkflow) + err = testdata.ValidateWorkflow(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, model.CompletedWorkflow) if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(simpleTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } err = testdata.TaskRunner.DecreaseBatchSize( - common.TestSimpleTask.ReferenceName(), + testdata.TestSimpleTask.ReferenceName(), testdata.WorkerQty, ) if err != nil { @@ -142,12 +141,12 @@ func TestInlineTask(t *testing.T) { inlineTaskWorkflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_INLINE_TASK"). Version(1). - Add(common.TestInlineTask) - err := testdata.ValidateWorkflow(inlineTaskWorkflow, common.WorkflowValidationTimeout, model.CompletedWorkflow) + Add(testdata.TestInlineTask) + err := testdata.ValidateWorkflow(inlineTaskWorkflow, testdata.WorkflowValidationTimeout, model.CompletedWorkflow) if err != nil { t.Fatal(err) } - err = testdata.ValidateWorkflowBulk(inlineTaskWorkflow, common.WorkflowValidationTimeout, common.WorkflowBulkQty) + err = testdata.ValidateWorkflowBulk(inlineTaskWorkflow, testdata.WorkflowValidationTimeout, testdata.WorkflowBulkQty) if err != nil { t.Fatal(err) } @@ -164,7 +163,7 @@ func TestSqsEventTask(t *testing.T) { workflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_EVENT_SQS"). Version(1). - Add(common.TestSqsEventTask) + Add(testdata.TestSqsEventTask) err := testdata.ValidateWorkflowRegistration(workflow) if err != nil { t.Fatal(err) @@ -182,7 +181,7 @@ func TestConductorEventTask(t *testing.T) { workflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_EVENT_CONDUCTOR"). Version(1). - Add(common.TestConductorEventTask) + Add(testdata.TestConductorEventTask) err := testdata.ValidateWorkflowRegistration(workflow) if err != nil { t.Fatal(err) @@ -200,7 +199,7 @@ func TestKafkaPublishTask(t *testing.T) { workflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_KAFKA_PUBLISH"). Version(1). - Add(common.TestKafkaPublishTask) + Add(testdata.TestKafkaPublishTask) err := testdata.ValidateWorkflowRegistration(workflow) if err != nil { t.Fatal(err) @@ -222,7 +221,7 @@ func TestTerminateTask(t *testing.T) { workflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_TERMINATE"). Version(1). - Add(common.TestTerminateTask) + Add(testdata.TestTerminateTask) err := testdata.ValidateWorkflowRegistration(workflow) if err != nil { t.Fatal(err) @@ -240,7 +239,7 @@ func TestSwitchTask(t *testing.T) { workflow := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_SWITCH"). Version(1). - Add(common.TestSwitchTask) + Add(testdata.TestSwitchTask) err := testdata.ValidateWorkflowRegistration(workflow) if err != nil { t.Fatal(err) diff --git a/test/integration_tests/workflow_definition_test.go b/test/integration_tests/workflow_definition_test.go index 4e8cd27b..a1b48f84 100644 --- a/test/integration_tests/workflow_definition_test.go +++ b/test/integration_tests/workflow_definition_test.go @@ -9,10 +9,9 @@ import ( "github.com/google/uuid" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/test/common" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" ) @@ -113,12 +112,12 @@ func TestExecuteWorkflowWithCorrelationIds(t *testing.T) { Name("TEST_GO_WORKFLOW_HTTP" + correlationId1). OwnerEmail("test@orkes.io"). Version(1). - Add(common.TestHttpTask) + Add(testdata.TestHttpTask) httpTaskWorkflow2 := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). Name("TEST_GO_WORKFLOW_HTTP" + correlationId2). OwnerEmail("test@orkes.io"). Version(1). - Add(common.TestHttpTask) + Add(testdata.TestHttpTask) _, err := httpTaskWorkflow1.StartWorkflow(&model.StartWorkflowRequest{CorrelationId: correlationId1}) if err != nil { t.Fatal(err) diff --git a/test/integration_tests/workflow_idempotency_test.go b/test/integration_tests/workflow_idempotency_test.go index 7224d49a..b65ea355 100644 --- a/test/integration_tests/workflow_idempotency_test.go +++ b/test/integration_tests/workflow_idempotency_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/conductor-sdk/conductor-go/internal/testdata" "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" ) diff --git a/internal/testdata/kitchensink.go b/test/testdata/kitchensink.go similarity index 100% rename from internal/testdata/kitchensink.go rename to test/testdata/kitchensink.go diff --git a/internal/testdata/util.go b/test/testdata/util.go similarity index 82% rename from internal/testdata/util.go rename to test/testdata/util.go index 39c988bb..51b3295d 100644 --- a/internal/testdata/util.go +++ b/test/testdata/util.go @@ -58,7 +58,6 @@ var ( IntegrationClient = client.NewIntegrationClient(apiClient) PromptClient = client.NewPromptClient(apiClient) UserClient = client.NewUserClient(apiClient) - ) var TaskRunner = worker.NewTaskRunnerWithApiClient(apiClient) @@ -249,3 +248,72 @@ func ValidateWorkflowDeletion(workflow *workflow.ConductorWorkflow) error { func isWorkflowCompleted(workflow *model.Workflow, expectedStatus model.WorkflowStatus) bool { return workflow.Status == expectedStatus } + +// Common Test Tasks +const ( + WorkflowValidationTimeout = 7 * time.Second + WorkflowBulkQty = 10 +) + +var ( + TestHttpTask = workflow.NewHttpTask( + "TEST_GO_TASK_HTTP", + &workflow.HttpInput{ + Uri: "https://orkes-api-tester.orkesconductor.com/get", + }, + ) + + TestSimpleTask = workflow.NewSimpleTask( + "TEST_GO_TASK_SIMPLE", "TEST_GO_TASK_SIMPLE", + ) + + TestTerminateTask = workflow.NewTerminateTask( + "TEST_GO_TASK_TERMINATE", + model.FailedWorkflow, + "Task used to mark workflow as failed", + ) + + TestSwitchTask = workflow.NewSwitchTask( + "TEST_GO_TASK_SWITCH", + "switchCaseValue", + ). + Input("switchCaseValue", "${workflow.input.service}"). + UseJavascript(true). + SwitchCase( + "REQUEST", + TestHttpTask, + ). + SwitchCase( + "STOP", + TestTerminateTask, + ) + + TestInlineTask = workflow.NewInlineTask( + "TEST_GO_TASK_INLINE", + "function e() { if ($.value == 1){return {\"result\": true}} else { return {\"result\": false}}} e();", + ) + + TestKafkaPublishTask = workflow.NewKafkaPublishTask( + "TEST_GO_TASK_KAFKA_PUBLISH", + &workflow.KafkaPublishTaskInput{ + Topic: "userTopic", + Value: "Message to publish", + BootStrapServers: "localhost:9092", + Headers: map[string]interface{}{ + "x-Auth": "Auth-key", + }, + Key: "123", + KeySerializer: "org.apache.kafka.common.serialization.IntegerSerializer", + }, + ) + + TestSqsEventTask = workflow.NewSqsEventTask( + "TEST_GO_TASK_EVENT_SQS", + "QUEUE", + ) + + TestConductorEventTask = workflow.NewConductorEventTask( + "TEST_GO_TASK_EVENT_CONDUCTOR", + "EVENT_NAME", + ) +) diff --git a/internal/testdata/worker.go b/test/testdata/worker.go similarity index 100% rename from internal/testdata/worker.go rename to test/testdata/worker.go diff --git a/test/unit_tests/workflow_def_test.go b/test/unit_tests/workflow_def_test.go index e7fb07ae..b71a9d65 100644 --- a/test/unit_tests/workflow_def_test.go +++ b/test/unit_tests/workflow_def_test.go @@ -3,10 +3,12 @@ package unit_tests import ( "encoding/json" "fmt" - "github.com/conductor-sdk/conductor-go/internal/testdata" + + "testing" + "github.com/conductor-sdk/conductor-go/sdk/workflow" + "github.com/conductor-sdk/conductor-go/test/testdata" "github.com/stretchr/testify/assert" - "testing" ) func TestRetrySettings(t *testing.T) {