package
0.0.0-20240117014531-197f627bdf8d
Repository: https://github.com/fornext-io/fornext.git
Documentation: pkg.go.dev

# Functions

IsAnyErrorWildcard represent where is ErrorEquals will matches any Error Names.
MustParseTime will parse string to time, it will panic when some error happened.
UnmarshalStateFromJSON will unmarshal the json's byte slice to State object.
ValidateErrorEquals validate ErrorEquals configuration.
ValidatePath validate the path string is a valid JSONPath(https://github.com/json-path/JsonPath) TODO.
ValidateReferencePath validate the reference path string is a valid JSONPath, But it can only identify a single node in a JSON structure: The operators "@", ",", ":", and "?" are not supported, And Reference Paths MUST be unambiguous references to a single value, array, or object (subtree).
ValidateTerminalState validate Next & End configuration.

# Constants

ErrorCodeStatesAll is a wildcard which matches any Error Name.
ErrorCodeStatesBranchFailed represent a branch of a Parallel State failed.
ErrorCodeStatesExceedToleratedFailureThreshold represent a Map state failed because the number of failed items exceeded the configured tolerated failure threshold.
ErrorCodeStatesHeartbeatTimeout represent a Task State failed to heartbeat for a time longer than the "HeartbeatSeconds" value.
ErrorCodeStatesIntrinsicFailure represent within a Payload Template, the attempt to invoke an Intrinsic Function failed.
ErrorCodeStatesItemReaderFailed represent a Map state failed to read all items as specified by the `ItemReader` field.
ErrorCodeStatesNoChoiceMatched represent a Choice State failed to find a match for the condition field extracted from its input.
ErrorCodeStatesParameterPathFailure represent within a state's "Parameters" field, the attempt to replace a field whose name ends in ".$" using a Path failed.
ErrorCodeStatesPermissions represent a Task State failed because it had insufficient privileges to execute the specified code.
ErrorCodeStatesPrefix is the prefix for pre defined ErrorCode.
ErrorCodeStatesResultPathMatchFailure represent a state's "ResultPath" field cannot be applied to the input the state received.
ErrorCodeStatesResultWriterFailed represent a Map state failed to write all results as specified by the `ResultWriter` field.
ErrorCodeStatesTaskFailed represent a Task State failed during the execution.
ErrorCodeStatesTimeout represent a Task State either ran longer than the "TimeoutSeconds" value, or failed to heartbeat for a time longer than the "HeartbeatSeconds" value.
FuncStatesArray takes zero or more arguments, returns a JSON array.
FuncStatesArrayContains to determine if a specific value is present in an array.
FuncStatesArrayGetItem returns a specified index's value.
FuncStatesArrayLength returns the length of an array.
FuncStatesArrayPartition to partition a large array: 1.
FuncStatesArrayRange to create a new array containing a specific range of elements.
FuncStatesArrayUnique removes duplicate values from an array and returns an array containing only unique elements.
FuncStatesBase64Decode to decode data base on MIME Base64 decoding scheme.
FuncStatesBase64Encode to encode data based on MIME Base64 scheme.
FuncStatesFormat takes one or more arguments and return first-argument string with each '{}' replaced by the value of positionally-corresponding argument.
FuncStatesHash to calculate the hash value of a given input.
FuncStatesJSONMerge to merge two JSON objects into a single object.
FuncStatesJSONToString takes a single aargument which MUST be a Path and return a string.
FuncStatesMathAdd to return the sum of two numbers.
FuncStatesMathRandom to return a random number between the specified start and end number.
FuncStatesStringSplit to split a string into an array of values.
FuncStatesStringToJSON takes a single argument whose Value MUST be a string.
FuncStatesUUID to return a version 4 universally unique identifier.
StateTypeChoice is the type of Choice State.
StateTypeFail is the type of Fail State.
StateTypeMap is the type of Map State.
StateTypeParallel is the type of Parallel State.
StateTypePass is the type of Pass State.
StateTypeSucceed is the type of Succeed State.
StateTypeTask is the type of Task State.
StateTypeWait is the type of Wait State.

# Variables

AllErrorCodes contains all pre defined error codes.
AllFuncs contains all pre defined funcs.

# Structs

BaseState is the struct for unmarshal State's Type field.
BranchProcessor is the `States` executed in parallel.
Catcher represent transitions when State's reports an error and there is no Retrier or retries have failed to resolve the error.
Choice is a JSON object may be evaluated to boolean value.
ChoiceRule may be evaluated to return a boolean value.
ChoiceState add branching logic to a state machine.
FailState terminates the machine and marks it as a failure.
ItemBatcher cause the interpreter to batch selected items.
ItemProcessor specify the `Map` state processing mode and definition.
MapState causes the interpreter to process all the elements of an array, potentially in parallel, with the processing of each element independent of the others.
ParallelState causes parallel executino of branches.
PassState by default passes its input to its output, performing no work.
Retrier represent when State's reports an error the interpreter can do.
StateMachine is the state machine represent of fsl.
SucceedState either terminates a state machine successfully, ends a branch of a Parallel Satte, or ends an iteration of a Map State.
TaskState causes the interpreter to execute the work identified by the state's `Resource` field.
WaitState causes the interpreter to delay the machine from continuing for a specified time.

# Interfaces

State represent a step of state machine.
StateContext is the represent of current state's information.

# Type aliases

Catchers must be an array of Catcher.
Path is a string, beginning with '$', used to identify components with a JSON text.
PayloadTemplate ia a JSON Object to reshape input data and output data to meet the format expectations of users.
ReferencePath is a Path with syntax limited as below: 1.
Retriers must be an array of Retrier.
StateFactory to construct a type reference State object.
States present a collection of state.
StateType present the type of State object.