model

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

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 (i Imports) HasPkgPath(pkgPath string) bool

func (Imports) IndexByPackage

func (i Imports) IndexByPackage() map[string]*Import

func (Imports) IsUnique

func (i Imports) IsUnique() bool

func (Imports) PkgPath

func (i Imports) PkgPath(pkg string) string

type Source

type Source struct {
	URL string `json:"url,omitempty" yaml:"url,omitempty"`
}

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

func NewWorkflow(name string) *Workflow

NewWorkflow creates a new workflow with the given name

func (*Workflow) AddDependency

func (w *Workflow) AddDependency(task *graph.Task) *Workflow

AddDependency adds a dependency task to the workflow

func (*Workflow) AllTasks

func (w *Workflow) AllTasks() map[string]*graph.Task

AllTasks returns all tasks in the workflow

func (*Workflow) Clone

func (w *Workflow) Clone() *Workflow

Clone creates a deep copy of the workflow

func (*Workflow) NewTask

func (w *Workflow) NewTask(name string) *graph.Task

NewTask creates a new task with the given name and adds it to the workflow pipeline

func (*Workflow) Validate added in v0.1.1

func (w *Workflow) Validate() []error

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

func (w *Workflow) WithConfig(key string, value interface{}) *Workflow

WithConfig adds a configuration parameter to the workflow

func (*Workflow) WithDescription

func (w *Workflow) WithDescription(description string) *Workflow

WithDescription sets the description of the workflow

func (*Workflow) WithInit

func (w *Workflow) WithInit(name string, value interface{}) *Workflow

WithInit adds an initialization parameter to the workflow

func (*Workflow) WithPipeline

func (w *Workflow) WithPipeline(pipeline *graph.Task) *Workflow

WithPipeline sets the main pipeline task for the workflow

func (*Workflow) WithPost

func (w *Workflow) WithPost(name string, value interface{}) *Workflow

WithPost adds a post-execution parameter to the workflow

func (*Workflow) WithVersion

func (w *Workflow) WithVersion(version string) *Workflow

WithVersion sets the version of the workflow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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