Documentation
¶
Overview ¶
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Index ¶
- Variables
- func AndShape() shape.Shape
- func AndToJSON(x *And) ([]byte, error)
- func ApplyAwaitOptionsShape() shape.Shape
- func ApplyShape() shape.Shape
- func ApplyToJSON(x *Apply) ([]byte, error)
- func AssignShape() shape.Shape
- func AssignToJSON(x *Assign) ([]byte, error)
- func AwaitShape() shape.Shape
- func AwaitToJSON(x *Await) ([]byte, error)
- func BaseStateShape() shape.Shape
- func CallbackShape() shape.Shape
- func CallbackToJSON(x *Callback) ([]byte, error)
- func ChooseShape() shape.Shape
- func ChooseToJSON(x *Choose) ([]byte, error)
- func CommandShape() shape.Shape
- func CommandToJSON(x Command) ([]byte, error)
- func CompareShape() shape.Shape
- func CompareToJSON(x *Compare) ([]byte, error)
- func DelayRunShape() shape.Shape
- func DelayRunToJSON(x *DelayRun) ([]byte, error)
- func DoneShape() shape.Shape
- func DoneToJSON(x *Done) ([]byte, error)
- func EndShape() shape.Shape
- func EndToJSON(x *End) ([]byte, error)
- func ErrorShape() shape.Shape
- func ErrorToJSON(x *Error) ([]byte, error)
- func ExecutePredicate(context BaseState, predicate Predicate, dep Dependency) (bool, error)
- func ExecuteReshaper(context BaseState, reshaper Reshaper) (schema.Schema, error)
- func ExprShape() shape.Shape
- func ExprToJSON(x Expr) ([]byte, error)
- func FlowRefShape() shape.Shape
- func FlowRefToJSON(x *FlowRef) ([]byte, error)
- func FlowShape() shape.Shape
- func FlowToJSON(x *Flow) ([]byte, error)
- func FunctionInputShape() shape.Shape
- func FunctionOutputShape() shape.Shape
- func GetRunID(state State) string
- func GetValueShape() shape.Shape
- func GetValueToJSON(x *GetValue) ([]byte, error)
- func MatchCommand[TOut any](x Command, f1 func(x *Run) TOut, f2 func(x *Callback) TOut, ...) TOut
- func MatchCommandR2[TOut1, TOut2 any](x Command, f1 func(x *Run) (TOut1, TOut2), f2 func(x *Callback) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchExpr[TOut any](x Expr, f1 func(x *End) TOut, f2 func(x *Assign) TOut, f3 func(x *Apply) TOut, ...) TOut
- func MatchExprR2[TOut1, TOut2 any](x Expr, f1 func(x *End) (TOut1, TOut2), f2 func(x *Assign) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchPredicate[TOut any](x Predicate, f1 func(x *And) TOut, f2 func(x *Or) TOut, f3 func(x *Not) TOut, ...) TOut
- func MatchPredicateR2[TOut1, TOut2 any](x Predicate, f1 func(x *And) (TOut1, TOut2), f2 func(x *Or) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchReshaper[TOut any](x Reshaper, f1 func(x *GetValue) TOut, f2 func(x *SetValue) TOut, ...) TOut
- func MatchReshaperR2[TOut1, TOut2 any](x Reshaper, f1 func(x *GetValue) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchRunOption[TOut any](x RunOption, f1 func(x *ScheduleRun) TOut, f2 func(x *DelayRun) TOut, ...) TOut
- func MatchRunOptionR2[TOut1, TOut2 any](x RunOption, f1 func(x *ScheduleRun) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchState[TOut any](x State, f1 func(x *NextOperation) TOut, f2 func(x *Done) TOut, ...) TOut
- func MatchStateR2[TOut1, TOut2 any](x State, f1 func(x *NextOperation) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchWorkflow[TOut any](x Workflow, f1 func(x *Flow) TOut, f2 func(x *FlowRef) TOut, ...) TOut
- func MatchWorkflowR2[TOut1, TOut2 any](x Workflow, f1 func(x *Flow) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchCommand[TOut any](x Command, f1 func(x *Run) TOut, f2 func(x *Callback) TOut, ...) TOut
- func MustMatchCommandR0(x Command, f1 func(x *Run), f2 func(x *Callback), f3 func(x *TryRecover), ...)
- func MustMatchCommandR2[TOut1, TOut2 any](x Command, f1 func(x *Run) (TOut1, TOut2), f2 func(x *Callback) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchExpr[TOut any](x Expr, f1 func(x *End) TOut, f2 func(x *Assign) TOut, f3 func(x *Apply) TOut, ...) TOut
- func MustMatchExprR0(x Expr, f1 func(x *End), f2 func(x *Assign), f3 func(x *Apply), ...)
- func MustMatchExprR2[TOut1, TOut2 any](x Expr, f1 func(x *End) (TOut1, TOut2), f2 func(x *Assign) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchPredicate[TOut any](x Predicate, f1 func(x *And) TOut, f2 func(x *Or) TOut, f3 func(x *Not) TOut, ...) TOut
- func MustMatchPredicateR0(x Predicate, f1 func(x *And), f2 func(x *Or), f3 func(x *Not), ...)
- func MustMatchPredicateR2[TOut1, TOut2 any](x Predicate, f1 func(x *And) (TOut1, TOut2), f2 func(x *Or) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchReshaper[TOut any](x Reshaper, f1 func(x *GetValue) TOut, f2 func(x *SetValue) TOut) TOut
- func MustMatchReshaperR0(x Reshaper, f1 func(x *GetValue), f2 func(x *SetValue))
- func MustMatchReshaperR2[TOut1, TOut2 any](x Reshaper, f1 func(x *GetValue) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchRunOption[TOut any](x RunOption, f1 func(x *ScheduleRun) TOut, f2 func(x *DelayRun) TOut) TOut
- func MustMatchRunOptionR0(x RunOption, f1 func(x *ScheduleRun), f2 func(x *DelayRun))
- func MustMatchRunOptionR2[TOut1, TOut2 any](x RunOption, f1 func(x *ScheduleRun) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchState[TOut any](x State, f1 func(x *NextOperation) TOut, f2 func(x *Done) TOut, ...) TOut
- func MustMatchStateR0(x State, f1 func(x *NextOperation), f2 func(x *Done), f3 func(x *Error), ...)
- func MustMatchStateR2[TOut1, TOut2 any](x State, f1 func(x *NextOperation) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchWorkflow[TOut any](x Workflow, f1 func(x *Flow) TOut, f2 func(x *FlowRef) TOut) TOut
- func MustMatchWorkflowR0(x Workflow, f1 func(x *Flow), f2 func(x *FlowRef))
- func MustMatchWorkflowR2[TOut1, TOut2 any](x Workflow, f1 func(x *Flow) (TOut1, TOut2), ...) (TOut1, TOut2)
- func NewMachine(di Dependency, state State) *machine.Machine[Command, State]
- func NextOperationShape() shape.Shape
- func NextOperationToJSON(x *NextOperation) ([]byte, error)
- func NotShape() shape.Shape
- func NotToJSON(x *Not) ([]byte, error)
- func OrShape() shape.Shape
- func OrToJSON(x *Or) ([]byte, error)
- func PredicateShape() shape.Shape
- func PredicateToJSON(x Predicate) ([]byte, error)
- func ReshaperShape() shape.Shape
- func ReshaperToJSON(x Reshaper) ([]byte, error)
- func ResumeOptionsShape() shape.Shape
- func ResumeScheduleShape() shape.Shape
- func ResumeScheduleToJSON(x *ResumeSchedule) ([]byte, error)
- func RunOptionShape() shape.Shape
- func RunOptionToJSON(x RunOption) ([]byte, error)
- func RunShape() shape.Shape
- func RunToJSON(x *Run) ([]byte, error)
- func ScheduleRunShape() shape.Shape
- func ScheduleRunToJSON(x *ScheduleRun) ([]byte, error)
- func ScheduleStoppedShape() shape.Shape
- func ScheduleStoppedToJSON(x *ScheduleStopped) ([]byte, error)
- func ScheduledShape() shape.Shape
- func ScheduledToJSON(x *Scheduled) ([]byte, error)
- func SetValueShape() shape.Shape
- func SetValueToJSON(x *SetValue) ([]byte, error)
- func StateShape() shape.Shape
- func StateToJSON(x State) ([]byte, error)
- func StopScheduleShape() shape.Shape
- func StopScheduleToJSON(x *StopSchedule) ([]byte, error)
- func ToStrExpr(expr Expr, depth int) string
- func ToStrPredicate(predicate Predicate, depth int) string
- func ToStrReshaper(reshaper Reshaper, depth int) string
- func ToStrSchema(x schema.Schema, depth int) string
- func ToStrWorkflow(workflow Workflow, depth int) string
- func TryRecoverShape() shape.Shape
- func TryRecoverToJSON(x *TryRecover) ([]byte, error)
- func WorkflowShape() shape.Shape
- func WorkflowToJSON(x Workflow) ([]byte, error)
- type And
- type Apply
- type ApplyAwaitOptions
- type Assign
- type Await
- type BaseState
- type Callback
- type Choose
- type Command
- type CommandUnionJSON
- type CommandVisitor
- type Compare
- type DI
- type DelayRun
- type Dependency
- type Done
- type End
- type Error
- type Execution
- type Expr
- type ExprUnionJSON
- type ExprVisitor
- type Flow
- type FlowRef
- type Function
- type FunctionInput
- type FunctionOutput
- type GetValue
- type NextOperation
- type Not
- type Or
- type Predicate
- type PredicateUnionJSON
- type PredicateVisitor
- type Reshaper
- type ReshaperUnionJSON
- type ReshaperVisitor
- type ResumeOptions
- type ResumeSchedule
- type Run
- type RunOption
- type RunOptionUnionJSON
- type RunOptionVisitor
- type ScheduleRun
- type ScheduleStopped
- type Scheduled
- type SetValue
- type State
- type StateUnionJSON
- type StateVisitor
- type StopSchedule
- type TryRecover
- type Workflow
- type WorkflowUnionJSON
- type WorkflowVisitor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyStarted = errors.New("already started") ErrCallbackNotMatch = errors.New("callback not match") ErrInvalidStateTransition = errors.New("invalid state transition") ErrExpressionHasResult = errors.New("expression has result") ErrStateReachEnd = errors.New("cannot apply commands, when workflow is completed") ErrMaxRetriesReached = errors.New("max retries reached") ErrFlowNotFound = errors.New("flow not found") ErrFlowNotSet = errors.New("flow not set") ErrIntervalParse = errors.New("failed to parse interval") ErrRunIDNotMatch = errors.New("run id not match") )
Functions ¶
func ApplyAwaitOptionsShape ¶ added in v1.21.1
func ApplyShape ¶ added in v1.21.1
func ApplyToJSON ¶ added in v1.21.1
func AssignShape ¶ added in v1.21.1
func AssignToJSON ¶ added in v1.21.1
func AwaitShape ¶ added in v1.21.1
func AwaitToJSON ¶ added in v1.21.1
func BaseStateShape ¶ added in v1.21.1
func CallbackShape ¶ added in v1.21.1
func CallbackToJSON ¶ added in v1.21.1
func ChooseShape ¶ added in v1.21.1
func ChooseToJSON ¶ added in v1.21.1
func CommandShape ¶ added in v1.21.1
func CommandToJSON ¶ added in v1.21.1
func CompareShape ¶ added in v1.21.1
func CompareToJSON ¶ added in v1.21.1
func DelayRunShape ¶ added in v1.21.1
func DelayRunToJSON ¶ added in v1.21.1
func DoneToJSON ¶ added in v1.21.1
func ErrorShape ¶ added in v1.21.1
func ErrorToJSON ¶ added in v1.21.1
func ExecutePredicate ¶
func ExecutePredicate(context BaseState, predicate Predicate, dep Dependency) (bool, error)
func ExecuteReshaper ¶
func ExprToJSON ¶ added in v1.21.1
func FlowRefShape ¶ added in v1.21.1
func FlowRefToJSON ¶ added in v1.21.1
func FlowToJSON ¶ added in v1.21.1
func FunctionInputShape ¶ added in v1.21.1
func FunctionOutputShape ¶ added in v1.21.1
func GetValueShape ¶ added in v1.21.1
func GetValueToJSON ¶ added in v1.21.1
func MatchCommand ¶ added in v1.21.1
func MatchCommand[TOut any]( x Command, f1 func(x *Run) TOut, f2 func(x *Callback) TOut, f3 func(x *TryRecover) TOut, f4 func(x *StopSchedule) TOut, f5 func(x *ResumeSchedule) TOut, df func(x Command) TOut, ) TOut
func MatchCommandR2 ¶ added in v1.21.1
func MatchCommandR2[TOut1, TOut2 any]( x Command, f1 func(x *Run) (TOut1, TOut2), f2 func(x *Callback) (TOut1, TOut2), f3 func(x *TryRecover) (TOut1, TOut2), f4 func(x *StopSchedule) (TOut1, TOut2), f5 func(x *ResumeSchedule) (TOut1, TOut2), df func(x Command) (TOut1, TOut2), ) (TOut1, TOut2)
func MatchExprR2 ¶ added in v1.21.1
func MatchPredicate ¶ added in v1.21.1
func MatchPredicateR2 ¶ added in v1.21.1
func MatchReshaper ¶ added in v1.21.1
func MatchReshaperR2 ¶ added in v1.21.1
func MatchRunOption ¶ added in v1.21.1
func MatchRunOption[TOut any]( x RunOption, f1 func(x *ScheduleRun) TOut, f2 func(x *DelayRun) TOut, df func(x RunOption) TOut, ) TOut
func MatchRunOptionR2 ¶ added in v1.21.1
func MatchRunOptionR2[TOut1, TOut2 any]( x RunOption, f1 func(x *ScheduleRun) (TOut1, TOut2), f2 func(x *DelayRun) (TOut1, TOut2), df func(x RunOption) (TOut1, TOut2), ) (TOut1, TOut2)
func MatchState ¶ added in v1.21.1
func MatchState[TOut any]( x State, f1 func(x *NextOperation) TOut, f2 func(x *Done) TOut, f3 func(x *Error) TOut, f4 func(x *Await) TOut, f5 func(x *Scheduled) TOut, f6 func(x *ScheduleStopped) TOut, df func(x State) TOut, ) TOut
func MatchStateR2 ¶ added in v1.21.1
func MatchStateR2[TOut1, TOut2 any]( x State, f1 func(x *NextOperation) (TOut1, TOut2), f2 func(x *Done) (TOut1, TOut2), f3 func(x *Error) (TOut1, TOut2), f4 func(x *Await) (TOut1, TOut2), f5 func(x *Scheduled) (TOut1, TOut2), f6 func(x *ScheduleStopped) (TOut1, TOut2), df func(x State) (TOut1, TOut2), ) (TOut1, TOut2)
func MatchWorkflow ¶ added in v1.21.1
func MatchWorkflowR2 ¶ added in v1.21.1
func MustMatchCommand ¶ added in v1.21.1
func MustMatchCommand[TOut any]( x Command, f1 func(x *Run) TOut, f2 func(x *Callback) TOut, f3 func(x *TryRecover) TOut, f4 func(x *StopSchedule) TOut, f5 func(x *ResumeSchedule) TOut, ) TOut
func MustMatchCommandR0 ¶ added in v1.21.1
func MustMatchCommandR0( x Command, f1 func(x *Run), f2 func(x *Callback), f3 func(x *TryRecover), f4 func(x *StopSchedule), f5 func(x *ResumeSchedule), )
func MustMatchCommandR2 ¶ added in v1.21.1
func MustMatchCommandR2[TOut1, TOut2 any]( x Command, f1 func(x *Run) (TOut1, TOut2), f2 func(x *Callback) (TOut1, TOut2), f3 func(x *TryRecover) (TOut1, TOut2), f4 func(x *StopSchedule) (TOut1, TOut2), f5 func(x *ResumeSchedule) (TOut1, TOut2), ) (TOut1, TOut2)
func MustMatchExpr ¶ added in v1.21.1
func MustMatchExprR0 ¶ added in v1.21.1
func MustMatchExprR2 ¶ added in v1.21.1
func MustMatchPredicate ¶ added in v1.21.1
func MustMatchPredicateR0 ¶ added in v1.21.1
func MustMatchPredicateR2 ¶ added in v1.21.1
func MustMatchReshaper ¶ added in v1.21.1
func MustMatchReshaperR0 ¶ added in v1.21.1
func MustMatchReshaperR2 ¶ added in v1.21.1
func MustMatchRunOption ¶ added in v1.21.1
func MustMatchRunOption[TOut any]( x RunOption, f1 func(x *ScheduleRun) TOut, f2 func(x *DelayRun) TOut, ) TOut
func MustMatchRunOptionR0 ¶ added in v1.21.1
func MustMatchRunOptionR0( x RunOption, f1 func(x *ScheduleRun), f2 func(x *DelayRun), )
func MustMatchRunOptionR2 ¶ added in v1.21.1
func MustMatchRunOptionR2[TOut1, TOut2 any]( x RunOption, f1 func(x *ScheduleRun) (TOut1, TOut2), f2 func(x *DelayRun) (TOut1, TOut2), ) (TOut1, TOut2)
func MustMatchState ¶ added in v1.21.1
func MustMatchState[TOut any]( x State, f1 func(x *NextOperation) TOut, f2 func(x *Done) TOut, f3 func(x *Error) TOut, f4 func(x *Await) TOut, f5 func(x *Scheduled) TOut, f6 func(x *ScheduleStopped) TOut, ) TOut
func MustMatchStateR0 ¶ added in v1.21.1
func MustMatchStateR0( x State, f1 func(x *NextOperation), f2 func(x *Done), f3 func(x *Error), f4 func(x *Await), f5 func(x *Scheduled), f6 func(x *ScheduleStopped), )
func MustMatchStateR2 ¶ added in v1.21.1
func MustMatchStateR2[TOut1, TOut2 any]( x State, f1 func(x *NextOperation) (TOut1, TOut2), f2 func(x *Done) (TOut1, TOut2), f3 func(x *Error) (TOut1, TOut2), f4 func(x *Await) (TOut1, TOut2), f5 func(x *Scheduled) (TOut1, TOut2), f6 func(x *ScheduleStopped) (TOut1, TOut2), ) (TOut1, TOut2)
func MustMatchWorkflow ¶ added in v1.21.1
func MustMatchWorkflowR0 ¶ added in v1.21.1
func MustMatchWorkflowR2 ¶ added in v1.21.1
func NewMachine ¶
func NextOperationShape ¶ added in v1.21.1
func NextOperationToJSON ¶ added in v1.21.1
func NextOperationToJSON(x *NextOperation) ([]byte, error)
func PredicateShape ¶ added in v1.21.1
func PredicateToJSON ¶ added in v1.21.1
func ReshaperShape ¶ added in v1.21.1
func ReshaperToJSON ¶ added in v1.21.1
func ResumeOptionsShape ¶ added in v1.21.1
func ResumeScheduleShape ¶ added in v1.21.1
func ResumeScheduleToJSON ¶ added in v1.21.1
func ResumeScheduleToJSON(x *ResumeSchedule) ([]byte, error)
func RunOptionShape ¶ added in v1.21.1
func RunOptionToJSON ¶ added in v1.21.1
func ScheduleRunShape ¶ added in v1.21.1
func ScheduleRunToJSON ¶ added in v1.21.1
func ScheduleRunToJSON(x *ScheduleRun) ([]byte, error)
func ScheduleStoppedShape ¶ added in v1.21.1
func ScheduleStoppedToJSON ¶ added in v1.21.1
func ScheduleStoppedToJSON(x *ScheduleStopped) ([]byte, error)
func ScheduledShape ¶ added in v1.21.1
func ScheduledToJSON ¶ added in v1.21.1
func SetValueShape ¶ added in v1.21.1
func SetValueToJSON ¶ added in v1.21.1
func StateShape ¶ added in v1.21.1
func StateToJSON ¶ added in v1.21.1
func StopScheduleShape ¶ added in v1.21.1
func StopScheduleToJSON ¶ added in v1.21.1
func StopScheduleToJSON(x *StopSchedule) ([]byte, error)
func ToStrPredicate ¶
func ToStrReshaper ¶
func ToStrWorkflow ¶
ToStrWorkflow returns string representation of workflow AST, a string is a meta program code, similar to go code, just declarative. Example:
func FlowHelloWorld(input string) string { var res string res = concat("hello ", input) return res }
func TryRecoverShape ¶ added in v1.21.1
func TryRecoverToJSON ¶ added in v1.21.1
func TryRecoverToJSON(x *TryRecover) ([]byte, error)
func WorkflowShape ¶ added in v1.21.1
func WorkflowToJSON ¶ added in v1.21.1
Types ¶
type And ¶
type And struct {
L []Predicate
}
func AndFromJSON ¶ added in v1.21.1
func (*And) AcceptPredicate ¶ added in v1.21.1
func (r *And) AcceptPredicate(v PredicateVisitor) any
func (*And) MarshalJSON ¶ added in v1.21.1
func (*And) UnmarshalJSON ¶ added in v1.21.1
type Apply ¶
type Apply struct { ID string Name string Args []Reshaper Await *ApplyAwaitOptions }
func ApplyFromJSON ¶ added in v1.21.1
func (*Apply) AcceptExpr ¶ added in v1.21.1
func (r *Apply) AcceptExpr(v ExprVisitor) any
func (*Apply) MarshalJSON ¶ added in v1.21.1
func (*Apply) UnmarshalJSON ¶ added in v1.21.1
type ApplyAwaitOptions ¶
type ApplyAwaitOptions struct {
Timeout int64
}
func (*ApplyAwaitOptions) MarshalJSON ¶ added in v1.21.1
func (r *ApplyAwaitOptions) MarshalJSON() ([]byte, error)
func (*ApplyAwaitOptions) UnmarshalJSON ¶ added in v1.21.1
func (r *ApplyAwaitOptions) UnmarshalJSON(data []byte) error
type Assign ¶
type Assign struct { ID string VarOk string // if VarErr is not empty, then error will be assigned to this variable // to give chance to handle it, before it will be returned to the caller // otherwise, any error will stop execution of the program VarErr string Val Expr }
func AssignFromJSON ¶ added in v1.21.1
func (*Assign) AcceptExpr ¶ added in v1.21.1
func (r *Assign) AcceptExpr(v ExprVisitor) any
func (*Assign) MarshalJSON ¶ added in v1.21.1
func (*Assign) UnmarshalJSON ¶ added in v1.21.1
type Await ¶
func AwaitFromJSON ¶ added in v1.21.1
func (*Await) AcceptState ¶ added in v1.21.1
func (r *Await) AcceptState(v StateVisitor) any
func (*Await) MarshalJSON ¶ added in v1.21.1
func (*Await) UnmarshalJSON ¶ added in v1.21.1
type BaseState ¶
type BaseState struct { Flow Workflow // Flow is a reference to the flow that describes execution RunID string // RunID is a unique identifier of the execution StepID string // StepID is a unique identifier of the step in the execution Variables map[string]schema.Schema ExprResult map[string]schema.Schema // Default values DefaultMaxRetries int64 RunOption RunOption }
func GetBaseState ¶
func (*BaseState) MarshalJSON ¶ added in v1.21.1
func (*BaseState) UnmarshalJSON ¶ added in v1.21.1
type Callback ¶
func CallbackFromJSON ¶ added in v1.21.1
func (*Callback) AcceptCommand ¶ added in v1.21.1
func (r *Callback) AcceptCommand(v CommandVisitor) any
func (*Callback) MarshalJSON ¶ added in v1.21.1
func (*Callback) UnmarshalJSON ¶ added in v1.21.1
type Choose ¶
func ChooseFromJSON ¶ added in v1.21.1
func (*Choose) AcceptExpr ¶ added in v1.21.1
func (r *Choose) AcceptExpr(v ExprVisitor) any
func (*Choose) MarshalJSON ¶ added in v1.21.1
func (*Choose) UnmarshalJSON ¶ added in v1.21.1
type Command ¶ added in v1.21.1
type Command interface {
AcceptCommand(g CommandVisitor) any
}
func CommandFromJSON ¶ added in v1.21.1
type CommandUnionJSON ¶ added in v1.21.1
type CommandUnionJSON struct { Type string `json:"$type,omitempty"` Run json.RawMessage `json:"workflow.Run,omitempty"` Callback json.RawMessage `json:"workflow.Callback,omitempty"` TryRecover json.RawMessage `json:"workflow.TryRecover,omitempty"` StopSchedule json.RawMessage `json:"workflow.StopSchedule,omitempty"` ResumeSchedule json.RawMessage `json:"workflow.ResumeSchedule,omitempty"` }
type CommandVisitor ¶ added in v1.21.1
type CommandVisitor interface { VisitRun(v *Run) any VisitCallback(v *Callback) any VisitTryRecover(v *TryRecover) any VisitStopSchedule(v *StopSchedule) any VisitResumeSchedule(v *ResumeSchedule) any }
type Compare ¶
func CompareFromJSON ¶ added in v1.21.1
func (*Compare) AcceptPredicate ¶ added in v1.21.1
func (r *Compare) AcceptPredicate(v PredicateVisitor) any
func (*Compare) MarshalJSON ¶ added in v1.21.1
func (*Compare) UnmarshalJSON ¶ added in v1.21.1
type DI ¶
type DI struct { FindFunctionF func(funcID string) (Function, error) FindWorkflowF func(flowID string) (*Flow, error) GenerateCallbackIDF func() string GenerateRunIDF func() string // Defaults DefaultMaxRetries int64 MockTimeNow *time.Time }
func (*DI) GenerateCallbackID ¶
func (*DI) GenerateRunID ¶
func (*DI) MaxRetries ¶
type DelayRun ¶
type DelayRun struct { // DelayBySeconds DelayBySeconds int64 }
func DelayRunFromJSON ¶ added in v1.21.1
func (*DelayRun) AcceptRunOption ¶ added in v1.21.1
func (r *DelayRun) AcceptRunOption(v RunOptionVisitor) any
func (*DelayRun) MarshalJSON ¶ added in v1.21.1
func (*DelayRun) UnmarshalJSON ¶ added in v1.21.1
type Dependency ¶
type Done ¶
func DoneFromJSON ¶ added in v1.21.1
func (*Done) AcceptState ¶ added in v1.21.1
func (r *Done) AcceptState(v StateVisitor) any
func (*Done) MarshalJSON ¶ added in v1.21.1
func (*Done) UnmarshalJSON ¶ added in v1.21.1
type End ¶
func EndFromJSON ¶ added in v1.21.1
func (*End) AcceptExpr ¶ added in v1.21.1
func (r *End) AcceptExpr(v ExprVisitor) any
func (*End) MarshalJSON ¶ added in v1.21.1
func (*End) UnmarshalJSON ¶ added in v1.21.1
type Error ¶
type Error struct { Code string Reason string Retried int64 //MaxRetries int64 BaseState BaseState }
func ErrorFromJSON ¶ added in v1.21.1
func (*Error) AcceptState ¶ added in v1.21.1
func (r *Error) AcceptState(v StateVisitor) any
func (*Error) MarshalJSON ¶ added in v1.21.1
func (*Error) UnmarshalJSON ¶ added in v1.21.1
type Expr ¶ added in v1.21.1
type Expr interface {
AcceptExpr(g ExprVisitor) any
}
func ExprFromJSON ¶ added in v1.21.1
type ExprUnionJSON ¶ added in v1.21.1
type ExprUnionJSON struct { Type string `json:"$type,omitempty"` End json.RawMessage `json:"workflow.End,omitempty"` Assign json.RawMessage `json:"workflow.Assign,omitempty"` Apply json.RawMessage `json:"workflow.Apply,omitempty"` Choose json.RawMessage `json:"workflow.Choose,omitempty"` }
type ExprVisitor ¶ added in v1.21.1
type Flow ¶
type Flow struct { Name string // name of the flow Arg string // name of the argument, which will hold the input to the flow Body []Expr }
func FlowFromJSON ¶ added in v1.21.1
func (*Flow) AcceptWorkflow ¶ added in v1.21.1
func (r *Flow) AcceptWorkflow(v WorkflowVisitor) any
func (*Flow) MarshalJSON ¶ added in v1.21.1
func (*Flow) UnmarshalJSON ¶ added in v1.21.1
type FlowRef ¶
type FlowRef struct {
FlowID string
}
func FlowRefFromJSON ¶ added in v1.21.1
func (*FlowRef) AcceptWorkflow ¶ added in v1.21.1
func (r *FlowRef) AcceptWorkflow(v WorkflowVisitor) any
func (*FlowRef) MarshalJSON ¶ added in v1.21.1
func (*FlowRef) UnmarshalJSON ¶ added in v1.21.1
type Function ¶
type Function func(args *FunctionInput) (*FunctionOutput, error)
type FunctionInput ¶
type FunctionInput struct { // Name acts as unique function ID Name string // CallbackID is used to identify callback function, and when its set // it means that function is async, and should return result by calling callback endpoint with CallbackID CallbackID string Args []schema.Schema }
func (*FunctionInput) MarshalJSON ¶ added in v1.21.1
func (r *FunctionInput) MarshalJSON() ([]byte, error)
func (*FunctionInput) UnmarshalJSON ¶ added in v1.21.1
func (r *FunctionInput) UnmarshalJSON(data []byte) error
type FunctionOutput ¶
func (*FunctionOutput) MarshalJSON ¶ added in v1.21.1
func (r *FunctionOutput) MarshalJSON() ([]byte, error)
func (*FunctionOutput) UnmarshalJSON ¶ added in v1.21.1
func (r *FunctionOutput) UnmarshalJSON(data []byte) error
type GetValue ¶
type GetValue struct {
Path string
}
func GetValueFromJSON ¶ added in v1.21.1
func (*GetValue) AcceptReshaper ¶ added in v1.21.1
func (r *GetValue) AcceptReshaper(v ReshaperVisitor) any
func (*GetValue) MarshalJSON ¶ added in v1.21.1
func (*GetValue) UnmarshalJSON ¶ added in v1.21.1
type NextOperation ¶
func NextOperationFromJSON ¶ added in v1.21.1
func NextOperationFromJSON(x []byte) (*NextOperation, error)
func (*NextOperation) AcceptState ¶ added in v1.21.1
func (r *NextOperation) AcceptState(v StateVisitor) any
func (*NextOperation) MarshalJSON ¶ added in v1.21.1
func (r *NextOperation) MarshalJSON() ([]byte, error)
func (*NextOperation) UnmarshalJSON ¶ added in v1.21.1
func (r *NextOperation) UnmarshalJSON(data []byte) error
type Not ¶
type Not struct {
P Predicate
}
func NotFromJSON ¶ added in v1.21.1
func (*Not) AcceptPredicate ¶ added in v1.21.1
func (r *Not) AcceptPredicate(v PredicateVisitor) any
func (*Not) MarshalJSON ¶ added in v1.21.1
func (*Not) UnmarshalJSON ¶ added in v1.21.1
type Or ¶
type Or struct {
L []Predicate
}
func OrFromJSON ¶ added in v1.21.1
func (*Or) AcceptPredicate ¶ added in v1.21.1
func (r *Or) AcceptPredicate(v PredicateVisitor) any
func (*Or) MarshalJSON ¶ added in v1.21.1
func (*Or) UnmarshalJSON ¶ added in v1.21.1
type Predicate ¶ added in v1.21.1
type Predicate interface {
AcceptPredicate(g PredicateVisitor) any
}
func PredicateFromJSON ¶ added in v1.21.1
type PredicateUnionJSON ¶ added in v1.21.1
type PredicateUnionJSON struct { Type string `json:"$type,omitempty"` And json.RawMessage `json:"workflow.And,omitempty"` Or json.RawMessage `json:"workflow.Or,omitempty"` Not json.RawMessage `json:"workflow.Not,omitempty"` Compare json.RawMessage `json:"workflow.Compare,omitempty"` }
type PredicateVisitor ¶ added in v1.21.1
type Reshaper ¶ added in v1.21.1
type Reshaper interface {
AcceptReshaper(g ReshaperVisitor) any
}
func ReshaperFromJSON ¶ added in v1.21.1
type ReshaperUnionJSON ¶ added in v1.21.1
type ReshaperUnionJSON struct { Type string `json:"$type,omitempty"` GetValue json.RawMessage `json:"workflow.GetValue,omitempty"` SetValue json.RawMessage `json:"workflow.SetValue,omitempty"` }
type ReshaperVisitor ¶ added in v1.21.1
type ResumeOptions ¶
type ResumeOptions struct {
Timeout int64
}
func (*ResumeOptions) MarshalJSON ¶ added in v1.21.1
func (r *ResumeOptions) MarshalJSON() ([]byte, error)
func (*ResumeOptions) UnmarshalJSON ¶ added in v1.21.1
func (r *ResumeOptions) UnmarshalJSON(data []byte) error
type ResumeSchedule ¶
type ResumeSchedule struct {
ParentRunID string
}
func ResumeScheduleFromJSON ¶ added in v1.21.1
func ResumeScheduleFromJSON(x []byte) (*ResumeSchedule, error)
func (*ResumeSchedule) AcceptCommand ¶ added in v1.21.1
func (r *ResumeSchedule) AcceptCommand(v CommandVisitor) any
func (*ResumeSchedule) MarshalJSON ¶ added in v1.21.1
func (r *ResumeSchedule) MarshalJSON() ([]byte, error)
func (*ResumeSchedule) UnmarshalJSON ¶ added in v1.21.1
func (r *ResumeSchedule) UnmarshalJSON(data []byte) error
type Run ¶
func RunFromJSON ¶ added in v1.21.1
func ScheduleNext ¶
func ScheduleNext(x State, dep Dependency) *Run
func (*Run) AcceptCommand ¶ added in v1.21.1
func (r *Run) AcceptCommand(v CommandVisitor) any
func (*Run) MarshalJSON ¶ added in v1.21.1
func (*Run) UnmarshalJSON ¶ added in v1.21.1
type RunOption ¶ added in v1.21.1
type RunOption interface {
AcceptRunOption(g RunOptionVisitor) any
}
func RunOptionFromJSON ¶ added in v1.21.1
type RunOptionUnionJSON ¶ added in v1.21.1
type RunOptionUnionJSON struct { Type string `json:"$type,omitempty"` ScheduleRun json.RawMessage `json:"workflow.ScheduleRun,omitempty"` DelayRun json.RawMessage `json:"workflow.DelayRun,omitempty"` }
type RunOptionVisitor ¶ added in v1.21.1
type RunOptionVisitor interface { VisitScheduleRun(v *ScheduleRun) any VisitDelayRun(v *DelayRun) any }
type ScheduleRun ¶
type ScheduleRun struct { // CRON like definition Interval string // ParentRunID is a reference to the original run, that scheduled this run and any between // ParentRunID is used to track history of the execution, and is stable reference to the original run ParentRunID string }
func ScheduleRunFromJSON ¶ added in v1.21.1
func ScheduleRunFromJSON(x []byte) (*ScheduleRun, error)
func (*ScheduleRun) AcceptRunOption ¶ added in v1.21.1
func (r *ScheduleRun) AcceptRunOption(v RunOptionVisitor) any
func (*ScheduleRun) MarshalJSON ¶ added in v1.21.1
func (r *ScheduleRun) MarshalJSON() ([]byte, error)
func (*ScheduleRun) UnmarshalJSON ¶ added in v1.21.1
func (r *ScheduleRun) UnmarshalJSON(data []byte) error
type ScheduleStopped ¶
type ScheduleStopped struct {
BaseState BaseState
}
func ScheduleStoppedFromJSON ¶ added in v1.21.1
func ScheduleStoppedFromJSON(x []byte) (*ScheduleStopped, error)
func (*ScheduleStopped) AcceptState ¶ added in v1.21.1
func (r *ScheduleStopped) AcceptState(v StateVisitor) any
func (*ScheduleStopped) MarshalJSON ¶ added in v1.21.1
func (r *ScheduleStopped) MarshalJSON() ([]byte, error)
func (*ScheduleStopped) UnmarshalJSON ¶ added in v1.21.1
func (r *ScheduleStopped) UnmarshalJSON(data []byte) error
type Scheduled ¶
type Scheduled struct { // ExpectedRunTimestamp is server timestamp + DelayBySeconds ExpectedRunTimestamp int64 BaseState BaseState }
Scheduled is a state that is used to schedule execution of the flow, once or periodically
func ScheduledFromJSON ¶ added in v1.21.1
func (*Scheduled) AcceptState ¶ added in v1.21.1
func (r *Scheduled) AcceptState(v StateVisitor) any
func (*Scheduled) MarshalJSON ¶ added in v1.21.1
func (*Scheduled) UnmarshalJSON ¶ added in v1.21.1
type SetValue ¶
func SetValueFromJSON ¶ added in v1.21.1
func (*SetValue) AcceptReshaper ¶ added in v1.21.1
func (r *SetValue) AcceptReshaper(v ReshaperVisitor) any
func (*SetValue) MarshalJSON ¶ added in v1.21.1
func (*SetValue) UnmarshalJSON ¶ added in v1.21.1
type State ¶ added in v1.21.1
type State interface {
AcceptState(g StateVisitor) any
}
func ExecuteAll ¶ added in v1.21.1
func ExecuteAll(context BaseState, x *Flow, dep Dependency) State
func ExecuteExpr ¶ added in v1.21.1
func ExecuteExpr(context BaseState, expr Expr, dep Dependency) State
func StateFromJSON ¶ added in v1.21.1
func Transition ¶ added in v1.21.1
func Transition(cmd Command, state State, dep Dependency) (State, error)
type StateUnionJSON ¶ added in v1.21.1
type StateUnionJSON struct { Type string `json:"$type,omitempty"` NextOperation json.RawMessage `json:"workflow.NextOperation,omitempty"` Done json.RawMessage `json:"workflow.Done,omitempty"` Error json.RawMessage `json:"workflow.Error,omitempty"` Await json.RawMessage `json:"workflow.Await,omitempty"` Scheduled json.RawMessage `json:"workflow.Scheduled,omitempty"` ScheduleStopped json.RawMessage `json:"workflow.ScheduleStopped,omitempty"` }
type StateVisitor ¶ added in v1.21.1
type StopSchedule ¶
type StopSchedule struct { // ParentRunID can be stopped by user, or by system ParentRunID string }
func StopScheduleFromJSON ¶ added in v1.21.1
func StopScheduleFromJSON(x []byte) (*StopSchedule, error)
func (*StopSchedule) AcceptCommand ¶ added in v1.21.1
func (r *StopSchedule) AcceptCommand(v CommandVisitor) any
func (*StopSchedule) MarshalJSON ¶ added in v1.21.1
func (r *StopSchedule) MarshalJSON() ([]byte, error)
func (*StopSchedule) UnmarshalJSON ¶ added in v1.21.1
func (r *StopSchedule) UnmarshalJSON(data []byte) error
type TryRecover ¶
type TryRecover struct {
RunID string
}
func TryRecoverFromJSON ¶ added in v1.21.1
func TryRecoverFromJSON(x []byte) (*TryRecover, error)
func (*TryRecover) AcceptCommand ¶ added in v1.21.1
func (r *TryRecover) AcceptCommand(v CommandVisitor) any
func (*TryRecover) MarshalJSON ¶ added in v1.21.1
func (r *TryRecover) MarshalJSON() ([]byte, error)
func (*TryRecover) UnmarshalJSON ¶ added in v1.21.1
func (r *TryRecover) UnmarshalJSON(data []byte) error
type Workflow ¶ added in v1.21.1
type Workflow interface {
AcceptWorkflow(g WorkflowVisitor) any
}
func WorkflowFromJSON ¶ added in v1.21.1
type WorkflowUnionJSON ¶ added in v1.21.1
type WorkflowUnionJSON struct { Type string `json:"$type,omitempty"` Flow json.RawMessage `json:"workflow.Flow,omitempty"` FlowRef json.RawMessage `json:"workflow.FlowRef,omitempty"` }
Source Files
¶
- workflow_inmemory.go
- workflow_machine.go
- workflow_machine_command_gen.go
- workflow_machine_expr_gen.go
- workflow_machine_predicate_gen.go
- workflow_machine_reshaper_gen.go
- workflow_machine_runoption_gen.go
- workflow_machine_serde_gen.go
- workflow_machine_state_gen.go
- workflow_machine_workflow_gen.go
- workflow_other.go
- workflow_other_serde_gen.go
- workflow_tostr.go
- workflow_transition.go
Click to show internal directories.
Click to hide internal directories.