Documentation
¶
Index ¶
- type Import
- type Imports
- type Source
- type Workflow
- func (w *Workflow) AddDependency(task *graph.Task) *Workflow
- func (w *Workflow) AllTasks() map[string]*graph.Task
- func (w *Workflow) Clone() *Workflow
- func (w *Workflow) NewTask(name string) *graph.Task
- func (w *Workflow) Validate() []error
- func (w *Workflow) WithConfig(key string, value interface{}) *Workflow
- func (w *Workflow) WithDescription(description string) *Workflow
- func (w *Workflow) WithInit(name string, value interface{}) *Workflow
- func (w *Workflow) WithPipeline(pipeline *graph.Task) *Workflow
- func (w *Workflow) WithPost(name string, value interface{}) *Workflow
- func (w *Workflow) WithVersion(version string) *Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Import ¶
type Import struct {
Package string `json:"package,omitempty" yaml:"package,omitempty"`
PkgPath string `json:"pkgPath,omitempty" yaml:"pkgPath,omitempty"`
}
Import represents a package import
type Imports ¶
type Imports []*Import
Imports represents a collection of package imports
func (Imports) HasPkgPath ¶
func (Imports) IndexByPackage ¶
type Workflow ¶
type Workflow struct {
// Source provides information about the origin of the workflow
Source *Source `json:"source,omitempty" yaml:"source,omitempty"`
// Name is the unique identifier for the workflow
Name string `json:"name" yaml:"name"`
// Description provides a human-readable description of the workflow
Description string `json:"description,omitempty" yaml:"description,omitempty"`
TypeName string `json:"typeName,omitempty" yaml:"typeName,omitempty"`
// Imports represents a collection of package imports
Imports Imports
// Version specifies the workflow version
Version string `json:"version,omitempty" yaml:"version,omitempty"`
// Init parameters are applied at the beginning of workflow execution
Init state.Parameters `json:"init,omitempty" yaml:"init,omitempty"`
// Pipeline defines the main execution graph of the workflow
Pipeline *graph.Task `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
// Dependencies define reusable tasks that can be referenced by ID
Dependencies map[string]*graph.Task `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
// Post parameters are applied at the end of workflow execution
Post state.Parameters `json:"post,omitempty" yaml:"post,omitempty"`
// Config contains workflow-level configuration
Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
AutoPause *bool `json:"autoPause,omitempty" yaml:"autoPause,omitempty"`
}
Workflow represents a workflow definition
func NewWorkflow ¶
NewWorkflow creates a new workflow with the given name
func (*Workflow) AddDependency ¶
AddDependency adds a dependency task to the workflow
func (*Workflow) NewTask ¶
NewTask creates a new task with the given name and adds it to the workflow pipeline
func (*Workflow) Validate ¶ added in v0.1.1
Validate performs a best-effort structural validation of the workflow. The returned slice is empty when the workflow is sound; otherwise it contains human-readable error descriptions. The function does NOT attempt to execute any expressions – it only verifies static properties.
func (*Workflow) WithConfig ¶
WithConfig adds a configuration parameter to the workflow
func (*Workflow) WithDescription ¶
WithDescription sets the description of the workflow
func (*Workflow) WithPipeline ¶
WithPipeline sets the main pipeline task for the workflow
func (*Workflow) WithVersion ¶
WithVersion sets the version of the workflow