package example import ( "context" "git.gorlug.de/code/ersteller/queue" "git.gorlug.de/code/ersteller/schema/ent" . "git.gorlug.de/code/ersteller/workflow" ) func CreateExampleWorkflow(client *ent.Client) { lastStep := NewStep(&StepParams{ Name: "Last step", Identifier: "last_step", Description: "Last step", Client: client, MaxRetries: 3, Handler: func(ctx context.Context, currentStep *Step, job queue.GeneralQueueJob) (queue.GeneralQueueHandlerResult, *Step, error) { return queue.GeneralQueueHandlerResult{ ResultPayload: map[string]interface{}{ "lastStep": "hello", }, }, nil, nil }, }) firstStep := NewStep(&StepParams{ Name: "Initial step", Identifier: "initial_step", Description: "Initial step", Client: client, MaxRetries: 3, Handler: func(ctx context.Context, currentStep *Step, job queue.GeneralQueueJob) (queue.GeneralQueueHandlerResult, *Step, error) { return queue.GeneralQueueHandlerResult{ ResultPayload: map[string]interface{}{ "firstStep": "hello", }, }, lastStep, nil }, }) NewWorkflow("Example", "example", firstStep) } //type name struct { // //}