composition

package
v0.0.0-...-fd57926 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteWorkflow

func ExecuteWorkflow(workflow *Workflow) error

ExecuteWorkflow executes the workflow steps

func ValidateWorkflow

func ValidateWorkflow(workflow *Workflow) []error

ValidateWorkflow validates the workflow structure and parameters

Types

type Step

type Step struct {
	// Unique name for the step (required)
	Name string `mapstructure:"name"`

	// Type of operation to perform (required)
	Type string `mapstructure:"type"`

	// Optional human-readable description of the step
	Description string `mapstructure:"description,omitempty"`

	// Optional conditional execution expression
	Condition string `mapstructure:"condition,omitempty"`

	// Flexible parameters for the step
	// Uses ",remain" to capture all additional parameters
	Parameters map[string]interface{} `mapstructure:",remain"`
}

Step represents a single step in the composition workflow

type StepHandler

type StepHandler func(step Step, variables map[string]interface{}) (map[string]interface{}, error)

StepHandler is a function that executes a workflow step

type Workflow

type Workflow struct {
	// Name of the workflow (required)
	Name string `mapstructure:"name"`

	// Optional description of the workflow
	Description string `mapstructure:"description,omitempty"`

	// Version of the workflow definition
	Version string `mapstructure:"version,omitempty"`

	// Author or creator of the workflow
	Author string `mapstructure:"author,omitempty"`

	// Ordered list of steps to execute
	Steps []Step `mapstructure:"steps"`

	// Variables that can be referenced in step parameters
	Variables map[string]interface{} `mapstructure:"variables,omitempty"`
}

Workflow represents the entire composition workflow

func LoadWorkflow

func LoadWorkflow(filePath string) (*Workflow, error)

LoadWorkflow loads a composition workflow from a file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL