examples

package
v0.19.1069 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivityWithByID

func ActivityWithByID(ctx context.Context, user User) error

ActivityWithByID demonstrates the by-id pattern @temporal-gen-v2 activity @by-field ID

func ActivityWithByIDOnly

func ActivityWithByIDOnly(ctx context.Context, user User) error

ActivityWithByIDOnly demonstrates the by-id-only pattern @temporal-gen-v2 activity @by-field ID @by-field-only

func ActivityWithCustomOptions

func ActivityWithCustomOptions(ctx context.Context, user User) error

ActivityWithCustomOptions demonstrates callback options @temporal-gen-v2 activity @options-callback GetUserActivityOptions

func ComplexActivity

func ComplexActivity(ctx context.Context, input int) (int, error)

ComplexActivity demonstrates all available activity options @temporal-gen-v2 activity @schedule-to-close-timeout 1h @start-to-close-timeout 30m @max-retries 5

func ComplexWorkflow

func ComplexWorkflow(ctx workflow.Context, input int) (int, error)

ComplexWorkflow demonstrates all available workflow options @temporal-gen-v2 workflow @execution-timeout 24h @task-timeout 10m @task-queue my-queue @wait-for-cancellation true

func GenerateWorkflowID

func GenerateWorkflowID(input string) string

func GetActivityOptions

func GetActivityOptions(input string) *workflow.ActivityOptions

func GetStatusQuery

func GetStatusQuery(ctx workflow.Context, input string) (string, error)

GetStatusQuery demonstrates a query handler for getting status @temporal-gen-v2 query

func GetUserActivityOptions

func GetUserActivityOptions(user User) *workflow.ActivityOptions

func GetWorkflowOptions

func GetWorkflowOptions(input string) *workflow.ChildWorkflowOptions

func QueryHandler

func QueryHandler(ctx workflow.Context, input string) (string, error)

QueryHandler demonstrates a query handler @temporal-gen-v2 query

func SimpleActivity

func SimpleActivity(ctx context.Context, input string) (string, error)

SimpleActivity is a basic activity with minimal configuration @temporal-gen-v2 activity

func SimpleWorkflow

func SimpleWorkflow(ctx workflow.Context, input string) (string, error)

SimpleWorkflow is a basic workflow @temporal-gen-v2 workflow

func UpdateHandler

func UpdateHandler(ctx workflow.Context, input string) (string, error)

UpdateHandler demonstrates an update handler @temporal-gen-v2 update @id my-update-id

func WorkflowWithCallerIDTemplate added in v0.19.850

func WorkflowWithCallerIDTemplate(ctx workflow.Context, input TaskInput) error

WorkflowWithCallerIDTemplate demonstrates nested workflow IDs using CallerID @temporal-gen-v2 workflow @id-template {{.CallerID}}-subtask-{{.Req.TaskID}}

func WorkflowWithIDCallback

func WorkflowWithIDCallback(ctx workflow.Context, input string) error

WorkflowWithIDCallback demonstrates dynamic ID generation @temporal-gen-v2 workflow @id-generator GenerateWorkflowID

func WorkflowWithIDTemplate

func WorkflowWithIDTemplate(ctx workflow.Context, input IDInput) error

WorkflowWithIDTemplate demonstrates custom ID templating @temporal-gen-v2 workflow @id-template workflow-{{.ID}}

func WorkflowWithOptionsCallback

func WorkflowWithOptionsCallback(ctx workflow.Context, input string) error

WorkflowWithOptionsCallback demonstrates custom options callback @temporal-gen-v2 workflow @options-callback GetWorkflowOptions

func WorkflowWithStructIDTemplate

func WorkflowWithStructIDTemplate(ctx workflow.Context, input IDTemplateInput) error

WorkflowWithStructIDTemplate demonstrates ID template with struct input @temporal-gen-v2 workflow @id-template org-{{.Req.OrgID}}-user-{{.Req.UserID}}

Types

type Activities

type Activities struct{}

type IDInput

type IDInput struct {
	ID string
}

type IDTemplateInput

type IDTemplateInput struct {
	OrgID  string
	UserID string
}

type MethodActivities

type MethodActivities struct{}

func (*MethodActivities) MyActivity

func (a *MethodActivities) MyActivity(ctx context.Context, input string) (string, error)

@temporal-gen-v2 activity @options-callback "GetActivityOptions"

type QueueActivity

type QueueActivity struct{}

type QueueWorkflowRequest

type QueueWorkflowRequest struct {
	QueueID string
}

type TaskInput added in v0.19.850

type TaskInput struct {
	TaskID string
}

type User

type User struct {
	ID   string
	Name string
}

type Workflows

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

func (*Workflows) Queue

@temporal-gen-v2 workflow @task-queue "queue" @id-template queue-{{.QueueID}}

type WrapperActivity

type WrapperActivity struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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