workflows

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Step

func Step[TPayload any](run *Run[TPayload], name string, step func(ctx context.Context) error)

func StepReturn

func StepReturn[TReturn any, TPayload any](run *Run[TPayload], name string, step func(ctx context.Context) (TReturn, error)) TReturn

Types

type Run

type Run[TPayload any] struct {
	Payload     TPayload
	TaskRetries int64
	// contains filtered or unexported fields
}

type StartOption added in v1.3.2

type StartOption func(state *startOptions)

WorkflowsOption configures workflows when creating them.

func WithName added in v1.3.1

func WithName(name string) StartOption

WithName configures a custom name for the workflow. By default it will be autogenerated. A custom name could be problematic with tombstones (workflow names that can't be repeated) and concurrency controls, so assign it with care and read Google Cloud Tasks documentation before using it.

type Workflow

type Workflow[TPayload any] struct {
	// contains filtered or unexported fields
}

func Define

func Define[TPayload any](name string, def func(run *Run[TPayload]) error) *Workflow[TPayload]

func (*Workflow[TPayload]) Start

func (w *Workflow[TPayload]) Start(ctx context.Context, queue cloudtasks.Queue, payload TPayload, opts ...StartOption) error

Jump to

Keyboard shortcuts

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