config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 4 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePathInConfig

func ResolvePathInConfig(cfg map[string]any, path string) string

ResolvePathInConfig resolves a path relative to the _config_dir stored in a module's config map. If the path is already absolute or no _config_dir is present, the original path is returned.

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 PluginRequirement

type PluginRequirement struct {
	Name    string `json:"name" yaml:"name"`
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
}

PluginRequirement specifies a required plugin with optional version constraint.

type RequiresConfig

type RequiresConfig struct {
	Capabilities []string            `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
	Plugins      []PluginRequirement `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

RequiresConfig declares what capabilities and plugins a workflow needs.

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"`
	Platform  map[string]any  `json:"platform,omitempty" yaml:"platform,omitempty"`
	Requires  *RequiresConfig `json:"requires,omitempty" yaml:"requires,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