-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e061a48
commit 81c92db
Showing
7 changed files
with
186 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
package flow | ||
|
||
type FailHandler func(*State, error) error | ||
type FailHandler func(State, error) error | ||
|
||
// Flow describes a process from beginning to end. It retains all defined steps, the user's final handler, and more. | ||
// Additionally, it offers a straightforward interface to access internal storage for marshaling and saving elsewhere. | ||
type Flow struct { | ||
// User's defined steps | ||
steps []Step | ||
// Calls after successfully passing full flow | ||
success StateHandler | ||
// Calls when user trigger fail step | ||
fail FailHandler | ||
then StateHandler | ||
// Calls on any error (@TODO: update the comment) | ||
catch FailHandler | ||
|
||
// User options | ||
|
||
// Determines whether we need to send errors from a validator to the user as a response. | ||
// If true, errors from a validator are responded, otherwise, no response is sent. | ||
useValidatorErrorsAsUserResponse bool | ||
UseValidatorErrorsAsUserResponse bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.