Documentation ¶
Index ¶
- Constants
- type ActionDefinition
- type ActionState
- type BranchMode
- type CallbackState
- type ConsumeEventDefinition
- type ConsumeEventState
- type DefaultStart
- type DelayState
- type ErrorDefinition
- type ErrorState
- type EventConditionDefinition
- type EventStart
- type EventsAndStart
- type EventsAndState
- type EventsXorStart
- type EventsXorState
- type ForEachState
- type FunctionDefinition
- type GenerateEventDefinition
- type GenerateEventState
- type NoopState
- type ParallelState
- type ProduceEventDefinition
- type RetryDefinition
- type ScheduledStart
- type SchemaDefinition
- type Size
- type StartCommon
- type StartDefinition
- type StartEventDefinition
- type StartType
- type State
- type StateCommon
- type StateType
- type SwitchConditionDefinition
- type SwitchState
- type TimeoutDefinition
- type ValidateState
- type Workflow
- func (o *Workflow) GetFunction(id string) (*FunctionDefinition, error)
- func (o *Workflow) GetFunctions() []FunctionDefinition
- func (o *Workflow) GetSchemas() []SchemaDefinition
- func (o *Workflow) GetStartDefinition() StartDefinition
- func (o *Workflow) GetStartState() State
- func (o *Workflow) GetStates() []State
- func (o *Workflow) GetStatesMap() map[string]State
- func (o *Workflow) Load(data []byte) error
- func (o *Workflow) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
View Source
const WorkflowIDRegex = "^[a-z][a-z0-9._-]{1,34}[a-z0-9]$"
WorkflowIDRegex - Regex used to validate ID
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionDefinition ¶
type ActionDefinition struct { Function string `yaml:"function,omitempty"` Workflow string `yaml:"workflow,omitempty"` Input string `yaml:"input,omitempty"` Secrets []string `yaml:"secrets,omitempty"` }
func (*ActionDefinition) Validate ¶
func (o *ActionDefinition) Validate() error
type ActionState ¶
type ActionState struct { StateCommon `yaml:",inline"` Action *ActionDefinition `yaml:"action"` Async bool `yaml:"async"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*ActionState) ErrorDefinitions ¶
func (o *ActionState) ErrorDefinitions() []ErrorDefinition
func (*ActionState) GetID ¶
func (o *ActionState) GetID() string
func (*ActionState) GetTransitions ¶
func (o *ActionState) GetTransitions() []string
func (*ActionState) Validate ¶
func (o *ActionState) Validate() error
type BranchMode ¶
type BranchMode int
const ( BranchModeAnd BranchMode = iota BranchModeOr )
func ParseBranchMode ¶
func ParseBranchMode(s string) (BranchMode, error)
func (BranchMode) MarshalJSON ¶
func (a BranchMode) MarshalJSON() ([]byte, error)
func (BranchMode) MarshalYAML ¶
func (a BranchMode) MarshalYAML() (interface{}, error)
func (BranchMode) String ¶
func (a BranchMode) String() string
func (*BranchMode) UnmarshalJSON ¶
func (a *BranchMode) UnmarshalJSON(data []byte) error
func (*BranchMode) UnmarshalYAML ¶
func (a *BranchMode) UnmarshalYAML(unmarshal func(interface{}) error) error
type CallbackState ¶
type CallbackState struct { StateCommon `yaml:",inline"` Action *ActionDefinition `yaml:"action"` Event *ConsumeEventDefinition `yaml:"event"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*CallbackState) ErrorDefinitions ¶
func (o *CallbackState) ErrorDefinitions() []ErrorDefinition
func (*CallbackState) GetID ¶
func (o *CallbackState) GetID() string
func (*CallbackState) GetTransitions ¶
func (o *CallbackState) GetTransitions() []string
func (*CallbackState) Validate ¶
func (o *CallbackState) Validate() error
type ConsumeEventDefinition ¶
type ConsumeEventDefinition struct { Type string `yaml:"type"` Context map[string]interface{} `yaml:"context,omitempty"` }
func (*ConsumeEventDefinition) Validate ¶
func (o *ConsumeEventDefinition) Validate() error
type ConsumeEventState ¶
type ConsumeEventState struct { StateCommon `yaml:",inline"` Event *ConsumeEventDefinition `yaml:"event"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*ConsumeEventState) ErrorDefinitions ¶
func (o *ConsumeEventState) ErrorDefinitions() []ErrorDefinition
func (*ConsumeEventState) GetID ¶
func (o *ConsumeEventState) GetID() string
func (*ConsumeEventState) GetTransitions ¶
func (o *ConsumeEventState) GetTransitions() []string
func (*ConsumeEventState) Validate ¶
func (o *ConsumeEventState) Validate() error
type DefaultStart ¶
type DefaultStart struct {
StartCommon `yaml:",inline"`
}
func (*DefaultStart) GetEvents ¶
func (o *DefaultStart) GetEvents() []StartEventDefinition
func (*DefaultStart) Validate ¶
func (o *DefaultStart) Validate() error
type DelayState ¶
type DelayState struct { StateCommon `yaml:",inline"` Duration string `yaml:"duration"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*DelayState) ErrorDefinitions ¶
func (o *DelayState) ErrorDefinitions() []ErrorDefinition
func (*DelayState) GetID ¶
func (o *DelayState) GetID() string
func (*DelayState) GetTransitions ¶
func (o *DelayState) GetTransitions() []string
func (*DelayState) Validate ¶
func (o *DelayState) Validate() error
type ErrorDefinition ¶
type ErrorDefinition struct { Error string `yaml:"error"` Retry *RetryDefinition `yaml:"retry,omitempty"` Transition string `yaml:"transition,omitempty"` }
func (*ErrorDefinition) Validate ¶
func (o *ErrorDefinition) Validate() error
type ErrorState ¶
type ErrorState struct { StateCommon `yaml:",inline"` Error string `yaml:"error"` Message string `yaml:"message"` Args []string `yaml:"args,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` }
func (*ErrorState) ErrorDefinitions ¶
func (o *ErrorState) ErrorDefinitions() []ErrorDefinition
func (*ErrorState) GetArgs ¶
func (o *ErrorState) GetArgs() []string
func (*ErrorState) GetID ¶
func (o *ErrorState) GetID() string
func (*ErrorState) GetTransitions ¶
func (o *ErrorState) GetTransitions() []string
func (*ErrorState) Validate ¶
func (o *ErrorState) Validate() error
type EventConditionDefinition ¶
type EventConditionDefinition struct { Event ConsumeEventDefinition `yaml:"event"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` }
type EventStart ¶
type EventStart struct { StartCommon `yaml:",inline"` Event *StartEventDefinition `yaml:"event"` }
func (*EventStart) GetEvents ¶
func (o *EventStart) GetEvents() []StartEventDefinition
func (*EventStart) Validate ¶
func (o *EventStart) Validate() error
type EventsAndStart ¶
type EventsAndStart struct { StartCommon `yaml:",inline"` LifeSpan string `yaml:"lifespan,omitempty"` Correlate []string `yaml:"correlate,omitempty"` Events []StartEventDefinition `yaml:"events"` }
func (*EventsAndStart) GetEvents ¶
func (o *EventsAndStart) GetEvents() []StartEventDefinition
func (*EventsAndStart) Validate ¶
func (o *EventsAndStart) Validate() error
type EventsAndState ¶
type EventsAndState struct { StateCommon `yaml:",inline"` Events []EventConditionDefinition `yaml:"events"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*EventsAndState) ErrorDefinitions ¶
func (o *EventsAndState) ErrorDefinitions() []ErrorDefinition
func (*EventsAndState) GetEvents ¶
func (o *EventsAndState) GetEvents() []EventConditionDefinition
func (*EventsAndState) GetID ¶
func (o *EventsAndState) GetID() string
func (*EventsAndState) GetTransitions ¶
func (o *EventsAndState) GetTransitions() []string
func (*EventsAndState) Validate ¶
func (o *EventsAndState) Validate() error
type EventsXorStart ¶
type EventsXorStart struct { StartCommon `yaml:",inline"` Events []StartEventDefinition `yaml:"events"` }
func (*EventsXorStart) GetEvents ¶
func (o *EventsXorStart) GetEvents() []StartEventDefinition
func (*EventsXorStart) Validate ¶
func (o *EventsXorStart) Validate() error
type EventsXorState ¶
type EventsXorState struct { StateCommon `yaml:",inline"` Events []EventConditionDefinition `yaml:"events"` Timeout string `yaml:"timeout,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*EventsXorState) ErrorDefinitions ¶
func (o *EventsXorState) ErrorDefinitions() []ErrorDefinition
func (*EventsXorState) GetEvents ¶
func (o *EventsXorState) GetEvents() []EventConditionDefinition
func (*EventsXorState) GetID ¶
func (o *EventsXorState) GetID() string
func (*EventsXorState) GetTransitions ¶
func (o *EventsXorState) GetTransitions() []string
func (*EventsXorState) Validate ¶
func (o *EventsXorState) Validate() error
type ForEachState ¶
type ForEachState struct { StateCommon `yaml:",inline"` Array string `yaml:"array"` Action *ActionDefinition `yaml:"action"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*ForEachState) ErrorDefinitions ¶
func (o *ForEachState) ErrorDefinitions() []ErrorDefinition
func (*ForEachState) GetID ¶
func (o *ForEachState) GetID() string
func (*ForEachState) GetTransitions ¶
func (o *ForEachState) GetTransitions() []string
func (*ForEachState) Validate ¶
func (o *ForEachState) Validate() error
type FunctionDefinition ¶
type FunctionDefinition struct { ID string `yaml:"id"` Image string `yaml:"image"` Size Size `yaml:"size,omitempty"` Cmd string `yaml:"cmd,omitempty"` }
func (*FunctionDefinition) Validate ¶
func (o *FunctionDefinition) Validate() error
type GenerateEventDefinition ¶
type GenerateEventDefinition struct { Type string `yaml:"type"` Source string `yaml:"source"` Data string `yaml:"string"` DataContentType string `yaml:"data_content_type,omitempty"` Context map[string]interface{} `yaml:"context,omitempty"` }
func (*GenerateEventDefinition) Validate ¶
func (o *GenerateEventDefinition) Validate() error
type GenerateEventState ¶
type GenerateEventState struct { StateCommon `yaml:",inline"` Event *GenerateEventDefinition `yaml:"event"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*GenerateEventState) ErrorDefinitions ¶
func (o *GenerateEventState) ErrorDefinitions() []ErrorDefinition
func (*GenerateEventState) GetID ¶
func (o *GenerateEventState) GetID() string
func (*GenerateEventState) GetTransitions ¶
func (o *GenerateEventState) GetTransitions() []string
func (*GenerateEventState) Validate ¶
func (o *GenerateEventState) Validate() error
type NoopState ¶
type NoopState struct { StateCommon `yaml:",inline"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*NoopState) ErrorDefinitions ¶
func (o *NoopState) ErrorDefinitions() []ErrorDefinition
func (*NoopState) GetTransitions ¶
type ParallelState ¶
type ParallelState struct { StateCommon `yaml:",inline"` Actions []ActionDefinition `yaml:"actions"` Mode BranchMode `yaml:"mode,omitempty"` Timeout string `yaml:"timeout,omitempty"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*ParallelState) ErrorDefinitions ¶
func (o *ParallelState) ErrorDefinitions() []ErrorDefinition
func (*ParallelState) GetActions ¶
func (o *ParallelState) GetActions() []ActionDefinition
func (*ParallelState) GetID ¶
func (o *ParallelState) GetID() string
func (*ParallelState) GetTransitions ¶
func (o *ParallelState) GetTransitions() []string
func (*ParallelState) Validate ¶
func (o *ParallelState) Validate() error
type ProduceEventDefinition ¶
type ProduceEventDefinition struct { Type string `yaml:"type,omitempty"` Source string `yaml:"source,omitempty"` Data string `yaml:"data"` Context map[string]interface{} `yaml:"context"` }
func (*ProduceEventDefinition) Validate ¶
func (o *ProduceEventDefinition) Validate() error
type RetryDefinition ¶
type RetryDefinition struct { MaxAttempts int `yaml:"max_attempts"` Delay string `yaml:"delay,omitempty"` Multiplier float64 `yaml:"multiplier,omitempty"` }
func (*RetryDefinition) Validate ¶
func (o *RetryDefinition) Validate() error
type ScheduledStart ¶
type ScheduledStart struct { StartCommon `yaml:",inline"` Cron string `yaml:"cron,omitempty"` }
func (*ScheduledStart) GetEvents ¶
func (o *ScheduledStart) GetEvents() []StartEventDefinition
func (*ScheduledStart) Validate ¶
func (o *ScheduledStart) Validate() error
type SchemaDefinition ¶
type SchemaDefinition struct { ID string `yaml:"id"` Schema interface{} `yaml:"schema"` }
func (*SchemaDefinition) Validate ¶
func (o *SchemaDefinition) Validate() error
type Size ¶
type Size int
Size string enum to differentiate function sizes
func (Size) MarshalJSON ¶
func (Size) MarshalYAML ¶
func (*Size) UnmarshalJSON ¶
func (*Size) UnmarshalYAML ¶
type StartCommon ¶
func (*StartCommon) GetState ¶
func (o *StartCommon) GetState() string
func (*StartCommon) GetType ¶
func (o *StartCommon) GetType() StartType
type StartDefinition ¶
type StartDefinition interface { GetState() string GetType() StartType Validate() error GetEvents() []StartEventDefinition }
type StartEventDefinition ¶
type StartEventDefinition struct { Type string `yaml:"type"` Filters map[string]interface{} `yaml:"filters,omitempty"` }
FIXME: Going to be renamed later
func (*StartEventDefinition) Validate ¶
func (o *StartEventDefinition) Validate() error
type StartType ¶
type StartType int
func ParseStartType ¶
func (StartType) MarshalJSON ¶
func (StartType) MarshalYAML ¶
func (*StartType) UnmarshalJSON ¶
func (*StartType) UnmarshalYAML ¶
type State ¶
type State interface { GetID() string GetType() StateType Validate() error ErrorDefinitions() []ErrorDefinition GetTransitions() []string // contains filtered or unexported methods }
type StateCommon ¶
func (*StateCommon) GetType ¶
func (o *StateCommon) GetType() StateType
type StateType ¶
type StateType int
func ParseStateType ¶
func (StateType) MarshalJSON ¶
func (StateType) MarshalYAML ¶
func (*StateType) UnmarshalJSON ¶
func (*StateType) UnmarshalYAML ¶
type SwitchConditionDefinition ¶
type SwitchConditionDefinition struct { Condition string `yaml:"condition"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` }
func (*SwitchConditionDefinition) Validate ¶
func (o *SwitchConditionDefinition) Validate() error
type SwitchState ¶
type SwitchState struct { StateCommon `yaml:",inline"` Conditions []SwitchConditionDefinition `yaml:"conditions"` Default string `yaml:"default,omitempty"` DefaultTransform string `yaml:"defaultTransform,omitempty"` DefaultTransition string `yaml:"defaultTransition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*SwitchState) ErrorDefinitions ¶
func (o *SwitchState) ErrorDefinitions() []ErrorDefinition
func (*SwitchState) GetConditions ¶
func (o *SwitchState) GetConditions() []SwitchConditionDefinition
func (*SwitchState) GetID ¶
func (o *SwitchState) GetID() string
func (*SwitchState) GetTransitions ¶
func (o *SwitchState) GetTransitions() []string
func (*SwitchState) Validate ¶
func (o *SwitchState) Validate() error
type TimeoutDefinition ¶
type TimeoutDefinition struct { Interrupt string `yaml:"interrupt,omitempty"` Kill string `yaml:"kill,omitempty"` }
func (*TimeoutDefinition) Validate ¶
func (o *TimeoutDefinition) Validate() error
type ValidateState ¶
type ValidateState struct { StateCommon `yaml:",inline"` Subject string `yaml:"subject"` Schema interface{} `yaml:"schema"` Transform string `yaml:"transform,omitempty"` Transition string `yaml:"transition,omitempty"` Catch []ErrorDefinition `yaml:"catch,omitempty"` }
func (*ValidateState) ErrorDefinitions ¶
func (o *ValidateState) ErrorDefinitions() []ErrorDefinition
func (*ValidateState) GetID ¶
func (o *ValidateState) GetID() string
func (*ValidateState) GetTransitions ¶
func (o *ValidateState) GetTransitions() []string
func (*ValidateState) Validate ¶
func (o *ValidateState) Validate() error
type Workflow ¶
type Workflow struct { ID string `yaml:"id"` Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Functions []FunctionDefinition `yaml:"functions,omitempty"` Schemas []SchemaDefinition `yaml:"schemas,omitempty"` States []State `yaml:"states,omitempty"` Timeouts *TimeoutDefinition `yaml:"timeouts,omitempty"` Start StartDefinition `yaml:"start,omitempty"` }
func (*Workflow) GetFunction ¶
func (o *Workflow) GetFunction(id string) (*FunctionDefinition, error)
func (*Workflow) GetFunctions ¶
func (o *Workflow) GetFunctions() []FunctionDefinition
func (*Workflow) GetSchemas ¶
func (o *Workflow) GetSchemas() []SchemaDefinition
func (*Workflow) GetStartDefinition ¶
func (o *Workflow) GetStartDefinition() StartDefinition
func (*Workflow) GetStartState ¶
func (*Workflow) GetStatesMap ¶
GetStatesMap : Get workflow states as a map
func (*Workflow) UnmarshalYAML ¶
Source Files ¶
- common-structures.go
- enums.go
- start-common.go
- start-default.go
- start-event.go
- start-events-and.go
- start-events-xor.go
- start-scheduled.go
- state-action.go
- state-callback.go
- state-common.go
- state-consume.go
- state-delay.go
- state-error.go
- state-events-and.go
- state-events-xor.go
- state-foreach.go
- state-generate-event.go
- state-noop.go
- state-parallel.go
- state-switch.go
- state-validate.go
- workflow.go
Click to show internal directories.
Click to hide internal directories.