Documentation ¶
Index ¶
- Variables
- func DefaultActivityOptions() workflow.ActivityOptions
- func DefaultUnwrap[T error](appErr *temporal.ApplicationError) error
- func DefaultWrap[T error](err error) (error, bool)
- func RegisterCustomError(errType string, unwrapFn UnwrapAppErrorFunc, wrapFn WrapErrorFunc)
- func RegisterCustomErrorDefault[T error](errType string)
- func UnwrapCustomError(appErr *temporal.ApplicationError) error
- func WrapCustomError(err error) error
- type Activity
- type ActivityRunFunc
- type ActivityTestScaffold
- func (a ActivityTestScaffold) RegisterActivity(act interface{})
- func (a ActivityTestScaffold) RegisterActivityWithOptions(act interface{}, options activity.RegisterOptions)
- func (a ActivityTestScaffold) RegisterWorkflow(w interface{})
- func (a ActivityTestScaffold) RegisterWorkflowWithOptions(w interface{}, options workflow.RegisterOptions)
- type ErrorWrapper
- type ExternalActivity
- type ExternalWorkflow
- func (w ExternalWorkflow[TInput, TResult]) Do(ctx context.Context, temporalClient client.Client, input TInput) (TResult, error)
- func (w ExternalWorkflow[TInput, TResult]) DoAsync(ctx context.Context, temporalClient client.Client, input TInput) (client.WorkflowRun, error)
- func (w ExternalWorkflow[TInput, TResult]) DoChild(wctx workflow.Context, input TInput) (TResult, error)
- func (w ExternalWorkflow[TInput, TResult]) DoChildAsync(wctx workflow.Context, input TInput) *TypedFuture[TResult]
- type FakeInput
- type HandleActivityFunc
- type HandleWorkflowFunc
- type OnResolvedFunc
- type PanicError
- type PostActivityFunc
- type PostRunFunc
- type Registrar
- type RunFunc
- type TypedFuture
- type UnwrapAppErrorFunc
- type UnwrapErrType
- type Workflow
- func (w Workflow[TConfig, TInput, TResult]) Do(ctx context.Context, temporalClient client.Client, input TInput) (TResult, error)
- func (w Workflow[TConfig, TInput, TResult]) DoAsync(ctx context.Context, temporalClient client.Client, input TInput) (client.WorkflowRun, error)
- func (w Workflow[TConfig, TInput, TResult]) DoChild(wctx workflow.Context, ctx context.Context, input TInput) (TResult, error)
- func (w Workflow[TConfig, TInput, TResult]) DoChildAsync(wctx workflow.Context, ctx context.Context, input TInput) *TypedFuture[TResult]
- func (w Workflow[TConfig, TInput, TResult]) Register(cfg TConfig, registry worker.Registry)
- type WorkflowInput
- type WorkflowTestScaffold
- func (a WorkflowTestScaffold) RegisterActivity(act interface{})
- func (a WorkflowTestScaffold) RegisterActivityWithOptions(act interface{}, options activity.RegisterOptions)
- func (a WorkflowTestScaffold) RegisterWorkflow(w interface{})
- func (a WorkflowTestScaffold) RegisterWorkflowWithOptions(w interface{}, options workflow.RegisterOptions)
- type WrapErrorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSystemCancellation = errors.New("system cancellation") ErrTimeout = errors.New("timed out") )
Functions ¶
func DefaultActivityOptions ¶
func DefaultActivityOptions() workflow.ActivityOptions
func DefaultUnwrap ¶
func DefaultUnwrap[T error](appErr *temporal.ApplicationError) error
func RegisterCustomError ¶
func RegisterCustomError(errType string, unwrapFn UnwrapAppErrorFunc, wrapFn WrapErrorFunc)
RegisterCustomError provides a centralized registry of custom errors that can be unwrapped using UnwrapCustomError
func UnwrapCustomError ¶
func UnwrapCustomError(appErr *temporal.ApplicationError) error
UnwrapCustomError unwraps a temporal.ApplicationError into a detailed error This is useful for serializing errors with details other than the error message
func WrapCustomError ¶
Types ¶
type Activity ¶
type Activity[TConfig any, TInput any, TResult any] struct { Name string Options workflow.ActivityOptions Run ActivityRunFunc[TConfig, TInput, TResult] // PostRun executes before completing the activity // This function executes inside the registered function of the activity // This function is useful for finalizing execution of an activity PostRun PostActivityFunc[TResult] // HandleResult executes after the activity completes // This function executes in the workflow that called the activity HandleResult HandleActivityFunc[TInput, TResult] }
type ActivityRunFunc ¶
type ActivityTestScaffold ¶
type ActivityTestScaffold struct { testsuite.WorkflowTestSuite Env *testsuite.TestActivityEnvironment T *testing.T }
func (ActivityTestScaffold) RegisterActivity ¶
func (a ActivityTestScaffold) RegisterActivity(act interface{})
func (ActivityTestScaffold) RegisterActivityWithOptions ¶
func (a ActivityTestScaffold) RegisterActivityWithOptions(act interface{}, options activity.RegisterOptions)
func (ActivityTestScaffold) RegisterWorkflow ¶
func (a ActivityTestScaffold) RegisterWorkflow(w interface{})
func (ActivityTestScaffold) RegisterWorkflowWithOptions ¶
func (a ActivityTestScaffold) RegisterWorkflowWithOptions(w interface{}, options workflow.RegisterOptions)
type ErrorWrapper ¶
type ErrorWrapper interface {
WrapError() error
}
type ExternalActivity ¶
type ExternalActivity[TInput any, TResult any] struct { Name string TaskQueue string Options workflow.ActivityOptions // HandleResult executes after the activity completes // This function executes in the workflow that called the activity HandleResult HandleActivityFunc[TInput, TResult] }
type ExternalWorkflow ¶
type ExternalWorkflow[TInput WorkflowInput, TResult any] struct { Name string TaskQueue string ParentClosePolicy enums.ParentClosePolicy // HandleResult executes after the child workflow completes // This function executes in the parent workflow that called the executing child workflow HandleResult OnResolvedFunc[TResult] }
func (ExternalWorkflow[TInput, TResult]) DoAsync ¶
func (w ExternalWorkflow[TInput, TResult]) DoAsync(ctx context.Context, temporalClient client.Client, input TInput) (client.WorkflowRun, error)
func (ExternalWorkflow[TInput, TResult]) DoChild ¶
func (w ExternalWorkflow[TInput, TResult]) DoChild(wctx workflow.Context, input TInput) (TResult, error)
func (ExternalWorkflow[TInput, TResult]) DoChildAsync ¶
func (w ExternalWorkflow[TInput, TResult]) DoChildAsync(wctx workflow.Context, input TInput) *TypedFuture[TResult]
type FakeInput ¶
type FakeInput struct {
TemporalWorkflowId string
}
func (FakeInput) GetTemporalWorkflowId ¶
func (FakeInput) SearchAttributes ¶
func (f FakeInput) SearchAttributes() []temporal.SearchAttributeUpdate
func (FakeInput) SpanAttributes ¶
type HandleActivityFunc ¶
type HandleWorkflowFunc ¶
type OnResolvedFunc ¶
type PanicError ¶
func (PanicError) Error ¶
func (e PanicError) Error() string
type PostActivityFunc ¶
type PostRunFunc ¶
type TypedFuture ¶
func NewFuture ¶
func NewFuture[T any](future workflow.Future, onResolved OnResolvedFunc[T]) *TypedFuture[T]
func NewResolvedFuture ¶
func NewResolvedFuture[T any](wctx workflow.Context, result T, err error) *TypedFuture[T]
func (*TypedFuture[T]) AddToSelector ¶
func (f *TypedFuture[T]) AddToSelector(wctx workflow.Context, selector workflow.Selector, fns ...func(f TypedFuture[T]) T)
func (*TypedFuture[T]) GetTyped ¶
func (f *TypedFuture[T]) GetTyped(wctx workflow.Context) (T, error)
func (*TypedFuture[T]) IsReady ¶
func (f *TypedFuture[T]) IsReady() bool
type UnwrapAppErrorFunc ¶
type UnwrapAppErrorFunc func(appErr *temporal.ApplicationError) error
type UnwrapErrType ¶
type UnwrapErrType string
const ( UnwrapErrTypeNone UnwrapErrType = "" UnwrapErrTypeFailure UnwrapErrType = "failure" UnwrapErrTypePanic UnwrapErrType = "panic" UnwrapErrTypeCancellation UnwrapErrType = "cancellation" UnwrapErrTypeTimeout UnwrapErrType = "timeout" )
func UnwrapError ¶
func UnwrapError(inputErr error) (UnwrapErrType, string, error)
UnwrapError takes an error from a workflow or activity and unwraps the Temporal skeleton to leave the base error This utilizes UnwrapCustomError to extract the strongly-typed error across workflow/activity boundaries
type Workflow ¶
type Workflow[TConfig any, TInput WorkflowInput, TResult any] struct { Name string TaskQueue string ParentClosePolicy enums.ParentClosePolicy Activities []Registrar[TConfig] Run RunFunc[TConfig, TInput, TResult] // PostRun executes before completing the child workflow // This function executes inside the registered function of the child workflow // This function is useful for finalizing execution of a child workflow PostRun PostRunFunc[TInput, TResult] // HandleResult executes after the child workflow completes // This function executes in the parent workflow that called the executing child workflow HandleResult HandleWorkflowFunc[TInput, TResult] }
func (Workflow[TConfig, TInput, TResult]) DoChildAsync ¶
type WorkflowInput ¶
type WorkflowTestScaffold ¶
type WorkflowTestScaffold struct { testsuite.WorkflowTestSuite Env *testsuite.TestWorkflowEnvironment T *testing.T }
func (WorkflowTestScaffold) RegisterActivity ¶
func (a WorkflowTestScaffold) RegisterActivity(act interface{})
func (WorkflowTestScaffold) RegisterActivityWithOptions ¶
func (a WorkflowTestScaffold) RegisterActivityWithOptions(act interface{}, options activity.RegisterOptions)
func (WorkflowTestScaffold) RegisterWorkflow ¶
func (a WorkflowTestScaffold) RegisterWorkflow(w interface{})
func (WorkflowTestScaffold) RegisterWorkflowWithOptions ¶
func (a WorkflowTestScaffold) RegisterWorkflowWithOptions(w interface{}, options workflow.RegisterOptions)
type WrapErrorFunc ¶
Click to show internal directories.
Click to hide internal directories.