Documentation
¶
Overview ¶
State Machine implementation
State Machine Parser
Index ¶
- Variables
- func DefaultHandler(_ context.Context, input interface{}) (interface{}, error)
- func Validate(sm_json *string) error
- type Execution
- func (sm *Execution) EnteredEvent(s state.State, input interface{})
- func (sm *Execution) ExitedEvent(s state.State, output interface{})
- func (sm *Execution) Failed()
- func (sm *Execution) Path() []string
- func (sm *Execution) SetLastOutput(output interface{}, err error)
- func (sm *Execution) SetOutput(output interface{}, err error)
- func (sm *Execution) Start()
- func (sm *Execution) Succeeded()
- type HistoryEvent
- type StateMachine
- func (sm *StateMachine) DefaultLambdaContext(lambda_name string) context.Context
- func (sm *StateMachine) Execute(input interface{}) (*Execution, error)
- func (sm *StateMachine) FindTask(name string) (*state.TaskState, error)
- func (sm *StateMachine) SetDefaultHandler()
- func (sm *StateMachine) SetResource(lambda_arn *string)
- func (sm *StateMachine) SetTaskFnHandlers(tfs *handler.TaskHandlers) error
- func (sm *StateMachine) SetTaskHandler(task_name string, resource_fn interface{}) error
- func (sm *StateMachine) Tasks() map[string]*state.TaskState
- func (sm *StateMachine) Validate() error
- type States
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyStateMachine = `{
"StartAt": "WIN",
"States": { "WIN": {"Type": "Succeed"}}
}`
EmptyStateMachine is a small Valid StateMachine
Functions ¶
func DefaultHandler ¶
Types ¶
type Execution ¶
type Execution struct { Output map[string]interface{} OutputJSON string Error error LastOutput map[string]interface{} // interim output LastOutputJSON string LastError error // interim error ExecutionHistory []HistoryEvent }
func (*Execution) EnteredEvent ¶
func (*Execution) ExitedEvent ¶
func (*Execution) SetLastOutput ¶
type HistoryEvent ¶
type HistoryEvent struct {
sfn.HistoryEvent
}
type StateMachine ¶
StateMachine the core struct for the machine
func FromJSON ¶
func FromJSON(raw []byte) (*StateMachine, error)
func ParseFile ¶
func ParseFile(file string) (*StateMachine, error)
Takes a file, and a map of Task Function s
func (*StateMachine) DefaultLambdaContext ¶
func (sm *StateMachine) DefaultLambdaContext(lambda_name string) context.Context
func (*StateMachine) Execute ¶
func (sm *StateMachine) Execute(input interface{}) (*Execution, error)
func (*StateMachine) FindTask ¶
func (sm *StateMachine) FindTask(name string) (*state.TaskState, error)
func (*StateMachine) SetDefaultHandler ¶
func (sm *StateMachine) SetDefaultHandler()
func (*StateMachine) SetResource ¶
func (sm *StateMachine) SetResource(lambda_arn *string)
func (*StateMachine) SetTaskFnHandlers ¶
func (sm *StateMachine) SetTaskFnHandlers(tfs *handler.TaskHandlers) error
func (*StateMachine) SetTaskHandler ¶
func (sm *StateMachine) SetTaskHandler(task_name string, resource_fn interface{}) error
func (*StateMachine) Validate ¶
func (sm *StateMachine) Validate() error
Click to show internal directories.
Click to hide internal directories.