Skip to content

Tags: TanmoySG/go-steps

Tags

v0.3.0-beta

Toggle v0.3.0-beta's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Added `UseArguments` field to specify which arguments to use [#6]

Merge pull request #6 from TanmoySG/runner-func-sig-change
---
Added `UseArguments` field to specify which arguments to use

In this PR, added the feature to pick between previous step returned values, or current step's arguments or use both as arguments to run the current step.

```go
var steps = gosteps.Step{
	Name: "add",
	Function: funcs.Add,
	StepArgs: []interface{}{2, 3},
	NextStep: gosteps.Steps{
		Name: "sub",
		Function:       funcs.Sub,
		StepArgs: []interface{}{4, 6},
		UseArguments: gosteps.CurrentStepArgs,
	},
}
```

Available configurations for `UseArguments`

```go
 // only previous step return will be passed to current step as arguments
 PreviousStepReturns stepArgChainingType = "PreviousStepReturns"

 // only current step arguments (StepArgs) will be passed to current step as arguments
 CurrentStepArgs stepArgChainingType = "CurrentStepArgs"

 // both previous step returns and current step arguments (StepArgs) will be passed
 // to current step as arguments - previous step returns, followed by current step args,
 PreviousReturnsWithCurrentStepArgs stepArgChainingType = "PreviousReturnsWithCurrentStepArgs"

 // both previous step returns and current step arguments (StepArgs) will be passed
 // to current step as arguments - current step args, followed by previous step returns
 CurrentStepArgsWithPreviousReturns stepArgChainingType = "CurrentStepArgsWithPreviousReturns"
```

Also refactored and added Unit Tests.

v0.2.0-beta

Toggle v0.2.0-beta's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Updated Step Type and Execution Flow [#5]

Merge pull request #5 from TanmoySG/dynamic-steps

v0.1.1-beta

Toggle v0.1.1-beta's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fix/Handle execution for no initial/entry step [#4]

Merge pull request #4 from TanmoySG/fix-no-initial-step

In v0.1-beta if there are no steps (no initial or subsequent steps) then the Execute() functions panics and exits. To Fix this adding a simple check to see if (initial) steps are not empty. If it is then no error is returned or no panics are caused.

if len(steps) == 0 {
	return nil, nil
}

v0.1.0-beta

Toggle v0.1.0-beta's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
GoSteps Initial Library [#1]

Merge pull request #1 from TanmoySG/steps-init

In this PR,
* Added GoSteps code to run functions as steps
* Added step Retry-ability
* Added documentation
* Added example