cadence

package
v0.0.0-...-ae8e89f Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func WithTestEnv

func WithTestEnv(testEnv *TestEnv) fx.Option

Types

type Runtime

type Runtime interface {
	RegisterWorkflow(w any, options workflow.RegisterOptions)
	RegisterActivity(a any, options activity.RegisterOptions)
	ExecuteWorkflow(ctx context.Context, options client.StartWorkflowOptions, workflow any, request any) (client.WorkflowRun, error)
	ExecuteActivity(ctx workflow.Context, activity any, request any, response any) error
	GetLogger(ctx workflow.Context) *zap.Logger
	GetMetricsHandler(ctx workflow.Context) client.MetricsHandler
	GetActivityLogger(ctx context.Context) *zap.Logger
	GetTimeSource(ctx workflow.Context) timesource.TimeSource
	TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string) error
	OnStart(ctx context.Context) error
	OnStop(ctx context.Context) error
	ListOpenWorkflows(ctx context.Context, namespace string, maxPageSize int32) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)
}

func NewRuntime

func NewRuntime(params RuntimeParams) (Runtime, error)

type RuntimeParams

type RuntimeParams struct {
	fx.In
	fxparams.Params
	TestEnv *TestEnv `optional:"true"`
}

type TestEnv

type TestEnv struct {
	*testsuite.TestWorkflowEnvironment
	// contains filtered or unexported fields
}

func NewTestActivityEnv

func NewTestActivityEnv(ts WorkflowTestSuite) *TestEnv

func NewTestEnv

func NewTestEnv(ts WorkflowTestSuite) *TestEnv

func (*TestEnv) BackgroundContext

func (e *TestEnv) BackgroundContext() workflow.Context

func (*TestEnv) IsActivityEnv

func (e *TestEnv) IsActivityEnv() bool

type WorkflowTestSuite

type WorkflowTestSuite interface {
	T() *testing.T
	NewTestWorkflowEnvironment() *testsuite.TestWorkflowEnvironment
	NewTestActivityEnvironment() *testsuite.TestActivityEnvironment
}

Jump to

Keyboard shortcuts

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