Documentation ¶
Index ¶
- func AssertWorkflowSpec(t *testing.T, expectedSpec, testWorkflowSpec sdk.WorkflowSpec)
- type Mock
- func (m Mock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
- func (m Mock) GetStep(ref string) StepResults[I, O]
- func (m Mock) ID() string
- func (m Mock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
- func (m Mock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
- func (m Mock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
- type NoopRuntime
- type Runner
- func (r *Runner) Config() []byte
- func (r *Runner) Err() error
- func (r *Runner) GetRegisteredMock(name string, step string) capabilities.ActionCapability
- func (r *Runner) MockCapability(name string, step *string, capability capabilities.ExecutableCapability)
- func (r *Runner) MockTrigger(trigger capabilities.TriggerCapability)
- func (r *Runner) Run(factory *sdk.WorkflowSpecFactory)
- type StepResults
- type TargetMock
- func (m TargetMock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
- func (t *TargetMock[I]) GetAllWrites() TargetResults[I]
- func (m TargetMock) GetStep(ref string) StepResults[I, O]
- func (m TargetMock) ID() string
- func (m TargetMock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
- func (m TargetMock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
- func (m TargetMock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
- type TargetResults
- type TriggerMock
- func (m TriggerMock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
- func (t *TriggerMock[O]) GetStep() TriggerResults[O]
- func (m TriggerMock) ID() string
- func (m TriggerMock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
- func (m TriggerMock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
- func (t *TriggerMock[O]) RegisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error)
- func (m TriggerMock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
- func (t *TriggerMock[O]) UnregisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) error
- type TriggerResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertWorkflowSpec ¶
func AssertWorkflowSpec(t *testing.T, expectedSpec, testWorkflowSpec sdk.WorkflowSpec)
Types ¶
type Mock ¶
type Mock[I, O any] struct { // contains filtered or unexported fields }
func (Mock) Execute ¶
func (m Mock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
func (Mock) GetStep ¶
func (m Mock) GetStep(ref string) StepResults[I, O]
func (Mock) Info ¶
func (m Mock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
func (Mock) RegisterToWorkflow ¶
func (m Mock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
func (Mock) UnregisterFromWorkflow ¶
func (m Mock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
type NoopRuntime ¶
type NoopRuntime struct{}
func (*NoopRuntime) Emitter ¶ added in v0.1.1
func (nr *NoopRuntime) Emitter() sdk.MessageEmitter
func (*NoopRuntime) Fetch ¶
func (nr *NoopRuntime) Fetch(sdk.FetchRequest) (sdk.FetchResponse, error)
func (*NoopRuntime) Logger ¶
func (nr *NoopRuntime) Logger() logger.Logger
type Runner ¶
type Runner struct { RawConfig []byte // contains filtered or unexported fields }
func (*Runner) GetRegisteredMock ¶
func (r *Runner) GetRegisteredMock(name string, step string) capabilities.ActionCapability
func (*Runner) MockCapability ¶
func (r *Runner) MockCapability(name string, step *string, capability capabilities.ExecutableCapability)
MockCapability registers a new capability mock with the runner if the step is not nil, the capability will be registered for that step If a step is explicitly mocked, that will take priority over a mock of the entire capability. This is best used with generated code to ensure correctness Note that mocks of custom compute will not be used in place of the user's code
func (*Runner) MockTrigger ¶
func (r *Runner) MockTrigger(trigger capabilities.TriggerCapability)
func (*Runner) Run ¶
func (r *Runner) Run(factory *sdk.WorkflowSpecFactory)
type StepResults ¶
type TargetMock ¶
type TargetMock[I any] struct { // contains filtered or unexported fields }
func MockTarget ¶
func MockTarget[I any](id string, fn func(I) error) *TargetMock[I]
func (TargetMock) Execute ¶
func (m TargetMock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
func (*TargetMock[I]) GetAllWrites ¶
func (t *TargetMock[I]) GetAllWrites() TargetResults[I]
func (TargetMock) GetStep ¶
func (m TargetMock) GetStep(ref string) StepResults[I, O]
func (TargetMock) Info ¶
func (m TargetMock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
func (TargetMock) RegisterToWorkflow ¶
func (m TargetMock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
func (TargetMock) UnregisterFromWorkflow ¶
func (m TargetMock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
type TargetResults ¶
type TriggerMock ¶
type TriggerMock[O any] struct { // contains filtered or unexported fields }
func MockTrigger ¶
func MockTrigger[O any](id string, fn func() (O, error)) *TriggerMock[O]
func (TriggerMock) Execute ¶
func (m TriggerMock) Execute(ctx context.Context, request capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error)
func (*TriggerMock[O]) GetStep ¶
func (t *TriggerMock[O]) GetStep() TriggerResults[O]
func (TriggerMock) Info ¶
func (m TriggerMock) Info(ctx context.Context) (capabilities.CapabilityInfo, error)
func (TriggerMock) RegisterToWorkflow ¶
func (m TriggerMock) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error
func (*TriggerMock[O]) RegisterTrigger ¶
func (t *TriggerMock[O]) RegisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error)
func (TriggerMock) UnregisterFromWorkflow ¶
func (m TriggerMock) UnregisterFromWorkflow(ctx context.Context, request capabilities.UnregisterFromWorkflowRequest) error
func (*TriggerMock[O]) UnregisterTrigger ¶
func (t *TriggerMock[O]) UnregisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) error
type TriggerResults ¶
Click to show internal directories.
Click to hide internal directories.