Documentation
¶
Index ¶
- Constants
- type Intermediate
- type Mock
- func (svc *Mock) Alias(ctx context.Context) (graph *workflow.Graph, err error)
- func (svc *Mock) MockAlias(...) *Mock
- func (svc *Mock) MockTaskA(...) *Mock
- func (svc *Mock) MockTaskB(...) *Mock
- func (svc *Mock) MockTaskC(...) *Mock
- func (svc *Mock) MockTaskD(...) *Mock
- func (svc *Mock) MockTaskS(...) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) TaskA(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Mock) TaskB(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Mock) TaskC(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Mock) TaskD(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Mock) TaskS(ctx context.Context, flow *workflow.Flow, branch string) (branchOut string, err error)
- type Service
- func (svc *Service) Alias(ctx context.Context) (graph *workflow.Graph, err error)
- func (svc *Service) Init(initializer func(svc *Service) (err error)) *Service
- func (svc *Service) OnShutdown(ctx context.Context) (err error)
- func (svc *Service) OnStartup(ctx context.Context) (err error)
- func (svc *Service) TaskA(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Service) TaskB(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Service) TaskC(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Service) TaskD(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
- func (svc *Service) TaskS(ctx context.Context, flow *workflow.Flow, branch string) (branchOut string, err error)
- type ToDo
Constants ¶
const ( Hostname = aliasflowapi.Hostname Version = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶
Intermediate extends and customizes the generic base connector.
func NewIntermediate ¶
func NewIntermediate(impl ToDo) *Intermediate
NewIntermediate creates a new instance of the intermediate.
type Mock ¶
type Mock struct {
*Intermediate
// contains filtered or unexported fields
}
Mock is a mockable version of the microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) MockAlias ¶
func (svc *Mock) MockAlias(handler func(ctx context.Context, flow *workflow.Flow, branch string) (path string, err error)) *Mock
MockAlias sets up a mock handler for the Alias workflow. The handler receives typed inputs from the workflow's state and returns typed outputs. A nil handler clears the mock.
func (*Mock) MockTaskA ¶
func (svc *Mock) MockTaskA(handler func(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)) *Mock
MockTaskA sets up a mock handler for TaskA.
func (*Mock) MockTaskB ¶
func (svc *Mock) MockTaskB(handler func(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)) *Mock
MockTaskB sets up a mock handler for TaskB.
func (*Mock) MockTaskC ¶
func (svc *Mock) MockTaskC(handler func(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)) *Mock
MockTaskC sets up a mock handler for TaskC.
func (*Mock) MockTaskD ¶
func (svc *Mock) MockTaskD(handler func(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)) *Mock
MockTaskD sets up a mock handler for TaskD.
func (*Mock) MockTaskS ¶
func (svc *Mock) MockTaskS(handler func(ctx context.Context, flow *workflow.Flow, branch string) (branchOut string, err error)) *Mock
MockTaskS sets up a mock handler for TaskS.
func (*Mock) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Mock) TaskA ¶
func (svc *Mock) TaskA(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskA executes the mock handler.
func (*Mock) TaskB ¶
func (svc *Mock) TaskB(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskB executes the mock handler.
func (*Mock) TaskC ¶
func (svc *Mock) TaskC(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskC executes the mock handler.
type Service ¶
type Service struct {
*Intermediate // IMPORTANT: Do not remove
}
Service implements aliasflow.verify, exercising a workflow graph in which the same task URL appears at two distinct positions under two distinct node names.
func (*Service) Alias ¶
Alias defines the graph s -> a -> b -> c -> END with an alternate Goto-driven path s -> bPrime -> d -> END. The two nodes "b" and "bPrime" share the same task URL (TaskB.URL()) but are independently identified in the graph and in the step history.
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Service) TaskA ¶
func (svc *Service) TaskA(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskA appends "A" to the path.
func (*Service) TaskB ¶
func (svc *Service) TaskB(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskB appends "B" to the path. Reused at two graph positions under names "b" and "bPrime".
func (*Service) TaskC ¶
func (svc *Service) TaskC(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error)
TaskC appends "C" to the path.
type ToDo ¶
type ToDo interface {
OnStartup(ctx context.Context) (err error)
OnShutdown(ctx context.Context) (err error)
TaskS(ctx context.Context, flow *workflow.Flow, branch string) (branchOut string, err error) // MARKER: TaskS
TaskA(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error) // MARKER: TaskA
TaskB(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error) // MARKER: TaskB
TaskC(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error) // MARKER: TaskC
TaskD(ctx context.Context, flow *workflow.Flow, path string) (pathOut string, err error) // MARKER: TaskD
Alias(ctx context.Context) (graph *workflow.Graph, err error) // MARKER: Alias
}
ToDo is implemented by the service or mock. The intermediate delegates handling to this interface.