Documentation
¶
Index ¶
- Variables
- type StateMachineBody
- type StepFunctionDecoder
- func (decoder *StepFunctionDecoder) Decode(definition string) (*states.StateMachine, error)
- func (sfDecoder *StepFunctionDecoder) DecodeBaseState(ctx context.Context, data map[string]any) (states.State, error)
- func (decoder *StepFunctionDecoder) DecodeState(ctx context.Context, data map[string]any) (states.State, error)
- func (sfDecoder *StepFunctionDecoder) DecodeStateDefinition(ctx context.Context, definition string) (states.State, error)
- func (decoder *StepFunctionDecoder) DecodeStateMachine(ctx context.Context, data map[string]any) (*states.StateMachine, error)
- func (sfdecoder *StepFunctionDecoder) DecodeStateMachineHeader(ctx context.Context, data map[string]interface{}) (*states.StateMachineHeader, error)
- func (sfdecoder *StepFunctionDecoder) DecodeStateMachineHeaderDefinition(definition string) (*states.StateMachineHeader, error)
- func (decoder *StepFunctionDecoder) DecodeTaskBody(ctx context.Context, data map[string]any) (*states.TaskBody, error)
- func (decoder *StepFunctionDecoder) DecodeTaskState(ctx context.Context, basestate *states.BaseState, data map[string]any) (states.State, error)
- type TaskBody
Constants ¶
This section is empty.
Variables ¶
var ( ErrorStateNameEmpty = errors.New("state name should not be empty") ErrorStateNameDuplicate = errors.New("state name should not be duplicate") )
ErrorLackOfRequiredField ...
var DefaultBaseState = states.BaseState{
MaxExecuteTimes: 1000,
InputPath: "$",
OutputPath: "$",
ResultPath: "$",
}
DefaultBaseState default state fields config default value from https://states-language.net/spec.html#Default
var DefaultTaskBody = TaskBody{
Resource: "",
TimeoutSeconds: 0,
HeartbeatSeconds: 0,
}
DefaultTaskBody ...
var StateMachineFields = struct { Comment string Version string Type string States string }{ Comment: "Comment", Version: "Version", Type: "Type", States: "States", }
StateMachineFields ...
Functions ¶
This section is empty.
Types ¶
type StateMachineBody ¶
StateMachineBody ...
type StepFunctionDecoder ¶
type StepFunctionDecoder struct {
*decoder.CommonDecoder
// contains filtered or unexported fields
}
StepFunctionDecoder decodes AWS Step Functions JSON definitions
func NewStepFunctionDecoder ¶
func NewStepFunctionDecoder(config *config.Config) *StepFunctionDecoder
NewStepFunctionDecoder creates a new StepFunctionDecoder instance
func (*StepFunctionDecoder) Decode ¶
func (decoder *StepFunctionDecoder) Decode(definition string) (*states.StateMachine, error)
Decode decodes a state machine definition from JSON string
func (*StepFunctionDecoder) DecodeBaseState ¶
func (sfDecoder *StepFunctionDecoder) DecodeBaseState(ctx context.Context, data map[string]any) (states.State, error)
DecodeBaseState decodes a base state from the given data map
func (*StepFunctionDecoder) DecodeState ¶
func (decoder *StepFunctionDecoder) DecodeState(ctx context.Context, data map[string]any) (states.State, error)
DecodeState decodes a state from the given data map
func (*StepFunctionDecoder) DecodeStateDefinition ¶
func (sfDecoder *StepFunctionDecoder) DecodeStateDefinition(ctx context.Context, definition string) (states.State, error)
DecodeStateDefinition decodes a state definition from JSON string
func (*StepFunctionDecoder) DecodeStateMachine ¶
func (decoder *StepFunctionDecoder) DecodeStateMachine(ctx context.Context, data map[string]any) (*states.StateMachine, error)
DecodeStateMachine ...
func (*StepFunctionDecoder) DecodeStateMachineHeader ¶
func (sfdecoder *StepFunctionDecoder) DecodeStateMachineHeader(ctx context.Context, data map[string]interface{}) ( *states.StateMachineHeader, error)
DecodeStateMachineHeader ...
func (*StepFunctionDecoder) DecodeStateMachineHeaderDefinition ¶
func (sfdecoder *StepFunctionDecoder) DecodeStateMachineHeaderDefinition(definition string) (*states.StateMachineHeader, error)
DecodeStateMachineHeaderDefintion ...
func (*StepFunctionDecoder) DecodeTaskBody ¶
func (decoder *StepFunctionDecoder) DecodeTaskBody(ctx context.Context, data map[string]any) ( *states.TaskBody, error)
DecodeTaskBody ...
type TaskBody ¶
type TaskBody struct {
Resource string `mapstructure:"Resource"`
TimeoutSeconds uint `mapstructure:"TimeoutSeconds"`
HeartbeatSeconds uint `mapstructure:"HeartbeatSeconds"`
Retry []map[string]any `mapstructure:"Retry"`
Catch []map[string]any `mapstructure:"Catch"`
}
TaskBody task body for stepfunction