Documentation ¶
Index ¶
- Constants
- Variables
- func DeepMap(input any, transform func(el any) (any, error)) (any, error)
- func EncodeExecutionID(workflowID, eventID string) (string, error)
- func GenerateJSONSchema() ([]byte, error)
- func ParseWorkflowSpecYaml(data string) (sdk.WorkflowSpec, error)
- func WFYamlSpec(t *testing.T, name, owner string) string
- type DependencyGraph
- type Mapping
- type Vertex
- type WorkflowSpecYaml
Constants ¶
View Source
const (
KeywordTrigger = "trigger"
)
Variables ¶
View Source
var (
InterpolationTokenRe = regexp.MustCompile(`^\$\((\S+)\)$`)
)
Functions ¶
func DeepMap ¶
DeepMap recursively applies a transformation function over each string within:
- a map[string]any
- a []any
- a string
func EncodeExecutionID ¶ added in v0.2.2
func GenerateJSONSchema ¶
func ParseWorkflowSpecYaml ¶
func ParseWorkflowSpecYaml(data string) (sdk.WorkflowSpec, error)
Types ¶
type DependencyGraph ¶
type DependencyGraph struct { ID string graph.Graph[string, *Vertex] Triggers []*sdk.StepDefinition Spec *sdk.WorkflowSpec }
DependencyGraph is an intermediate representation of a workflow wherein all the graph vertices are represented and validated. It is a static representation of the workflow dependencies.
func BuildDependencyGraph ¶ added in v0.2.2
func BuildDependencyGraph(spec sdk.WorkflowSpec) (*DependencyGraph, error)
type Mapping ¶ added in v0.2.2
func (Mapping) MarshalJSON ¶ added in v0.2.2
func (*Mapping) UnmarshalJSON ¶ added in v0.2.2
type Vertex ¶
type Vertex struct { sdk.StepDefinition Dependencies []string }
type WorkflowSpecYaml ¶ added in v0.2.2
type WorkflowSpecYaml struct { Name string `json:"name,omitempty" jsonschema:"pattern=^[0-9A-Za-z_\\-]+$,maxLength=10"` // plain text string exactly 10 characters long, or empty name allowed for anonymous workflows //Name nameYaml `json:"name"` Owner string `json:"owner,omitempty" jsonschema:"pattern=^0x[0-9a-fA-F]{40}$"` // 20 bytes represented as hex string with 0x prefix, or empty owner allowed for anonymous workflows // Triggers define a starting condition for the workflow, based on specific events or conditions. Triggers []triggerDefinitionYaml `json:"triggers" jsonschema:"required"` // Actions represent a discrete operation within the workflow, potentially transforming input data. Actions []stepDefinitionYaml `json:"actions,omitempty"` // Consensus encapsulates the logic for aggregating and validating the results from various nodes. Consensus []stepDefinitionYaml `json:"consensus,omitempty"` // Targets represents the final step of the workflow, delivering the processed data to a specified location. Targets []stepDefinitionYaml `json:"targets" jsonschema:"required"` // contains filtered or unexported fields }
WorkflowSpecYaml is the YAML representation of a workflow spec.
It allows for multiple ways of defining a workflow spec, which we later convert to a single representation, `WorkflowSpec`.
func (WorkflowSpecYaml) ToWorkflowSpec ¶ added in v0.2.2
func (w WorkflowSpecYaml) ToWorkflowSpec() sdk.WorkflowSpec
ToWorkflowSpec converts a WorkflowSpecYaml to a WorkflowSpec.
We support multiple ways of defining a workflow spec yaml, but internally we want to work with a single representation.
Directories ¶
Path | Synopsis |
---|---|
host
NOTE: loosely based on: https://github.com/tetratelabs/wazero/blob/1353ca24fef0a57a3a342d75f20357a6e9d3be35/internal/wasip1/errno.go#L14
|
NOTE: loosely based on: https://github.com/tetratelabs/wazero/blob/1353ca24fef0a57a3a342d75f20357a6e9d3be35/internal/wasip1/errno.go#L14 |
Click to show internal directories.
Click to hide internal directories.