workflows

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRandomDogActivity

func FetchRandomDogActivity(ctx context.Context, params map[string]interface{}) (*schema.DocumentCreate, error)

FetchRandomDogActivity calls the dog.ceo api for a random dog picture

func FetchRandomUnsplashActivity

func FetchRandomUnsplashActivity(ctx context.Context, params map[string]interface{}) (*schema.DocumentCreate, error)

FetchRandomUnsplashActivity calls unsplash to get a random photo

func InitActivity

func InitActivity(ctx context.Context, params map[string]interface{}) (string, error)

InitActivity

func RandomDogWorkflow

func RandomDogWorkflow(ctx workflow.Context, params map[string]interface{}) (*schema.WorkflowInstanceUpdate, error)

RandomDogWorkflow is a Hello World workflow definition.

func RandomUnsplashWorkflow

func RandomUnsplashWorkflow(ctx workflow.Context, params map[string]interface{}) (*schema.WorkflowInstanceUpdate, error)

RandomUnsplashWorkflow is a Hello World workflow definition.

Types

type WorkflowClient

type WorkflowClient struct {
	// contains filtered or unexported fields
}

WorkflowClient holds the temporal client and queue

func NewWorkflowStarter

func NewWorkflowStarter(hostPort, queue string) (*WorkflowClient, error)

NewWorkflowStarter returns a new workflow starter with a temporal client

func (*WorkflowClient) Query

func (ws *WorkflowClient) Query(workflowID, instanceID string) *schema.WorkflowInstanceUpdate

Query a workflow status

func (*WorkflowClient) Start

func (ws *WorkflowClient) Start(workflowID string, params map[string]interface{}) *schema.WorkflowInstanceUpdate

Start kicks of a workflow

func (*WorkflowClient) StartWorkflowWorker

func (ws *WorkflowClient) StartWorkflowWorker(ctx context.Context)

StartWorkflowWorker connects to temporal and listens for workflows

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL