Documentation ¶
Index ¶
Constants ¶
const (
KeywordTrigger = "trigger"
)
Variables ¶
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 GenerateJSONSchema ¶
Types ¶
type DependencyGraph ¶
type DependencyGraph struct { ID string graph.Graph[string, *Vertex] Triggers []*StepDefinition Spec *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 ParseDependencyGraph ¶ added in v0.2.0
func ParseDependencyGraph(yamlWorkflow string) (*DependencyGraph, error)
type StepDefinition ¶ added in v0.2.0
type StepDefinition struct { ID string Ref string Inputs StepInputs Config map[string]any CapabilityType capabilities.CapabilityType }
StepDefinition is the parsed representation of a step in a workflow.
Within the workflow spec, they are called "Capability Properties".
type StepInputs ¶ added in v0.2.0
type Vertex ¶
type Vertex struct { StepDefinition Dependencies []string }
type WorkflowSpec ¶ added in v0.2.0
type WorkflowSpec struct { Name string Owner string Triggers []StepDefinition Actions []StepDefinition Consensus []StepDefinition Targets []StepDefinition // contains filtered or unexported fields }
WorkflowSpec is the parsed representation of a workflow. It is a derived representation of the yaml spec. Marshalling this struct is not guaranteed to produce the original yaml spec. Access the original yaml spec using the `String` method.
func ParseWorkflowSpecYaml ¶
func ParseWorkflowSpecYaml(data string) (WorkflowSpec, error)
func (*WorkflowSpec) CID ¶ added in v0.2.0
func (w *WorkflowSpec) CID() string
CID returns the content hash of the original yaml spec of the workflow.
func (*WorkflowSpec) Steps ¶ added in v0.2.0
func (w *WorkflowSpec) Steps() []StepDefinition
func (*WorkflowSpec) String ¶ added in v0.2.0
func (w *WorkflowSpec) String() string
String returns the original yaml spec of the workflow.