config

package
v0.0.0-...-dac86b4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleConfig

type ModuleConfig struct {
	Name      string            `json:"name" yaml:"name"`
	Type      string            `json:"type" yaml:"type"`
	Config    map[string]any    `json:"config,omitempty" yaml:"config,omitempty"`
	DependsOn []string          `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"`
	Branches  map[string]string `json:"branches,omitempty" yaml:"branches,omitempty"`
}

ModuleConfig represents a single module configuration

type PipelineConfig

type PipelineConfig struct {
	Trigger      PipelineTriggerConfig `json:"trigger" yaml:"trigger"`
	Steps        []PipelineStepConfig  `json:"steps" yaml:"steps"`
	OnError      string                `json:"on_error,omitempty" yaml:"on_error,omitempty"`
	Timeout      string                `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Compensation []PipelineStepConfig  `json:"compensation,omitempty" yaml:"compensation,omitempty"`
}

PipelineConfig represents a single composable pipeline definition.

type PipelineStepConfig

type PipelineStepConfig struct {
	Name    string         `json:"name" yaml:"name"`
	Type    string         `json:"type" yaml:"type"`
	Config  map[string]any `json:"config,omitempty" yaml:"config,omitempty"`
	OnError string         `json:"on_error,omitempty" yaml:"on_error,omitempty"`
	Timeout string         `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

PipelineStepConfig defines a single step in a pipeline.

type PipelineTriggerConfig

type PipelineTriggerConfig struct {
	Type   string         `json:"type" yaml:"type"`
	Config map[string]any `json:"config,omitempty" yaml:"config,omitempty"`
}

PipelineTriggerConfig defines what starts a pipeline.

type WorkflowConfig

type WorkflowConfig struct {
	Modules   []ModuleConfig `json:"modules" yaml:"modules"`
	Workflows map[string]any `json:"workflows" yaml:"workflows"`
	Triggers  map[string]any `json:"triggers" yaml:"triggers"`
	Pipelines map[string]any `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
	ConfigDir string         `json:"-" yaml:"-"` // directory containing the config file, used for relative path resolution
}

WorkflowConfig represents the overall configuration for the workflow engine

func LoadFromFile

func LoadFromFile(filepath string) (*WorkflowConfig, error)

LoadFromFile loads a workflow configuration from a YAML file

func LoadFromString

func LoadFromString(yamlContent string) (*WorkflowConfig, error)

LoadFromString loads a workflow configuration from a YAML string.

func NewEmptyWorkflowConfig

func NewEmptyWorkflowConfig() *WorkflowConfig

NewEmptyWorkflowConfig creates a new empty workflow configuration

func (*WorkflowConfig) ResolveRelativePath

func (c *WorkflowConfig) ResolveRelativePath(path string) string

ResolveRelativePath resolves a path relative to the config file's directory. If the path is absolute, it is returned as-is.

Jump to

Keyboard shortcuts

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