Help us shape the future of Go! Take the 2026 Go Developer Survey

pipeline

package
v1.321.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2026 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

View Source
const (
	DefaultIssuerURL   = "https://issuer-backend.eudiw.dev"
	DefaultVerifierURL = "https://capture-wallet.credimi.io"
	DefaultLogChecker  = "eudiw"
)
View Source
const (
	// RunTypeMemoKey carries the pipeline run type through Temporal memo.
	RunTypeMemoKey = "pipeline_run_type"
	// RunTypeManual marks runs started directly by a user.
	RunTypeManual = "manual"
	// RunTypeScheduled marks runs started by a Temporal schedule.
	RunTypeScheduled = "scheduled"
	// RunTypeCI marks runs started by CI integrations.
	RunTypeCI = "CI"
)
View Source
const AllStepOutputs = "*"

AllStepOutputs in a ReferencedStepOutputs result means the whole outputs are referenced.

View Source
const PipelineCancellationPolicySignal = "pipeline-cancellation-policy"

Variables

This section is empty.

Functions

func ApplyFixture

func ApplyFixture(workflow *WorkflowDefinition) error

ApplyFixture substitutes service-profile values throughout a workflow. Keeping this at the parsed workflow boundary lets one FCAF scenario run against multiple issuer/verifier fixtures without duplicating the scenario.

func ApplyFunction

func ApplyFunction(value any, funcName string) (any, error)

func ExpressionRefs

func ExpressionRefs(s string) []string

ExpressionRefs returns the trimmed bodies of every ${{ ... }} expression in s.

func MergeConfigs

func MergeConfigs(global, step map[string]any) map[string]any

MergeConfigs merges global config with step-level config. Step keys win, except server-owned keys (workflowengine.IsServerOwnedConfigKey), which keep their global value.

func ParseEntityIDs

func ParseEntityIDs(yamlStr string) (workflowengine.EntityIDs, error)

func ParsePipeline

func ParsePipeline(expr string) (initialValue string, functions []string, err error)

ParsePipeline parses a pipeline expression in the form "value | function1 | function2", returning the initial value and the remaining pipeline segments as function names.

func ReferencedStepOutputs

func ReferencedStepOutputs(def *WorkflowDefinition, stepID string) []string

ReferencedStepOutputs returns the keys of stepID's outputs that expressions anywhere in def reference, sorted and unique. It returns AllStepOutputs when an expression references the step's outputs as a whole or the aggregated pipeline_output, and an empty result when nothing references them.

func RequiredStepIDs

func RequiredStepIDs(inputs StepInputs) []string

RequiredStepIDs returns the IDs of the steps whose outputs the step inputs need, sorted and unique. A reference counts when its expression does not start with the `optional` function; `pipeline_output.<id>` references count for <id>.

func ResolveExpressions

func ResolveExpressions(val any, ctx map[string]any) (any, error)

resolveExpressions recursively replaces ${{ ... }} expressions in a value

func ResolveInputs

func ResolveInputs(
	step *StepDefinition,
	globalCfg map[string]any,
	ctx map[string]any,
) error

ResolveInputs builds activity input for a step

func ResolvePipeline

func ResolvePipeline(expr string, ctx map[string]any) (any, error)

func ValidRunType

func ValidRunType(value string) bool

ValidRunType reports whether value is accepted by the pipeline_results type field.

func ValidateStepIDs

func ValidateStepIDs(def *WorkflowDefinition) error

ValidateStepIDs checks that main step IDs identify a single step each, so that a step_id recorded in the run's history maps to exactly one main step. Hook and finally step IDs may repeat among themselves but must not reuse a main step ID. Empty IDs are ignored.

Types

type ActivityOptionsConfig

type ActivityOptionsConfig struct {
	ScheduleToCloseTimeout string      `yaml:"schedule_to_close_timeout,omitempty" json:"schedule_to_close_timeout,omitempty"` //nolint
	StartToCloseTimeout    string      `yaml:"start_to_close_timeout,omitempty"    json:"start_to_close_timeout,omitempty"`
	HeartbeatTimeout       string      `yaml:"heartbeat_timeout,omitempty"         json:"heartbeat_timeout,omitempty"`
	RetryPolicy            RetryPolicy `yaml:"retry_policy,omitempty"              json:"retry_policy,omitempty,omitzero"`
}

type FinallyDefinition

type FinallyDefinition struct {
	Always    []FinallyStepDefinition `yaml:"always,omitempty"     json:"always,omitempty"`
	OnSuccess []FinallyStepDefinition `yaml:"on_success,omitempty" json:"on_success,omitempty"`
	OnFailure []FinallyStepDefinition `yaml:"on_failure,omitempty" json:"on_failure,omitempty"`
}

func (FinallyDefinition) AllSteps

func (FinallyDefinition) IsZero

func (f FinallyDefinition) IsZero() bool

func (*FinallyDefinition) UnmarshalJSON

func (f *FinallyDefinition) UnmarshalJSON(data []byte) error

func (*FinallyDefinition) UnmarshalYAML

func (f *FinallyDefinition) UnmarshalYAML(value *yaml.Node) error

type FinallyStepDefinition

type FinallyStepDefinition struct {
	StepSpec `yaml:",inline" json:",inline"`
}

type OnErrorStepDefinition

type OnErrorStepDefinition struct {
	StepSpec `yaml:",inline" json:",inline"`
}

type OnSuccessStepDefinition

type OnSuccessStepDefinition struct {
	StepSpec `yaml:",inline" json:",inline"`
}

type PipelineCancellationPolicy

type PipelineCancellationPolicy struct {
	Reason               string   `json:"reason"`
	SkipDeviceCleanup    bool     `json:"skip_device_cleanup"`
	SkipDeviceCleanupIDs []string `json:"skip_device_cleanup_ids,omitempty"`
}

type RetryPolicy

type RetryPolicy struct {
	MaximumAttempts    int32   `yaml:"maximum_attempts,omitempty"    json:"maximum_attempts,omitempty"`
	InitialInterval    string  `yaml:"initial_interval,omitempty"    json:"initial_interval,omitempty"`
	MaximumInterval    string  `yaml:"maximum_interval,omitempty"    json:"maximum_interval,omitempty"`
	BackoffCoefficient float64 `yaml:"backoff_coefficient,omitempty" json:"backoff_coefficient,omitempty"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Fixture  map[string]string `yaml:"fixture,omitempty"  json:"fixture,omitempty"`
	Schedule struct {
		Interval *time.Duration `yaml:"interval,omitempty" json:"interval,omitempty"`
	} `yaml:"schedule,omitempty" json:"schedule,omitempty,omitzero"`
	// GlobalDeviceID is retained as an internal Go field while callers are migrated;
	// the serialized pipeline contract is exclusively global_device_id.
	GlobalDeviceID          string `yaml:"global_device_id,omitempty"           json:"global_device_id,omitempty"`
	DisableAndroidPlayStore bool   `yaml:"disable_android_play_store,omitempty" json:"disable_android_play_store,omitempty"`
	// NoVideo skips the device screen recording for runs that would outlast the
	// recording time limit anyway; the device log and a final screenshot are kept.
	NoVideo  bool `yaml:"no_video,omitempty" json:"no_video,omitempty"`
	Debug    bool `yaml:"debug,omitempty"    json:"debug,omitempty"`
	Temporal struct {
		ExecutionTimeout string                `yaml:"execution_timeout,omitempty" json:"execution_timeout,omitempty"`
		ActivityOptions  ActivityOptionsConfig `yaml:"activity_options,omitempty" json:"activity_options,omitempty,omitzero"`
	} `yaml:"temporal,omitempty" json:"temporal,omitempty,omitzero"`
}

type StepDefinition

type StepDefinition struct {
	StepSpec        `                           yaml:",inline"                     json:",inline"`
	ContinueOnError bool                       `yaml:"continue_on_error,omitempty" json:"continue_on_error,omitempty"`
	OnError         []*OnErrorStepDefinition   `yaml:"on_error,omitempty"          json:"on_error,omitempty"`
	OnSuccess       []*OnSuccessStepDefinition `yaml:"on_success,omitempty"        json:"on_success,omitempty"`
}

type StepInputs

type StepInputs struct {
	Config  map[string]any `yaml:"config,omitempty"  json:"config,omitempty"`
	Payload map[string]any `yaml:"payload,omitempty" json:"payload,omitempty"`
}

func (*StepInputs) UnmarshalJSON

func (s *StepInputs) UnmarshalJSON(data []byte) error

func (*StepInputs) UnmarshalYAML

func (s *StepInputs) UnmarshalYAML(value *yaml.Node) error

type StepSpec

type StepSpec struct {
	ID              string                 `yaml:"id"                         json:"id"`
	Use             string                 `yaml:"use"                        json:"use"`
	With            StepInputs             `yaml:"with"                       json:"with"`
	ActivityOptions *ActivityOptionsConfig `yaml:"activity_options,omitempty" json:"activity_options,omitempty"`
	Metadata        map[string]any         `yaml:"metadata,omitempty"         json:"metadata,omitempty"`
}

type WorkflowDefinition

type WorkflowDefinition struct {
	Version string            `yaml:"version,omitempty" json:"version,omitempty"`
	Name    string            `yaml:"name"              json:"name"`
	Runtime RuntimeConfig     `yaml:"runtime,omitempty" json:"runtime,omitempty,omitzero"`
	Config  map[string]any    `yaml:"config,omitempty"  json:"config,omitempty"`
	Steps   []StepDefinition  `yaml:"steps,omitempty"   json:"steps,omitempty"`
	Finally FinallyDefinition `yaml:"finally,omitempty" json:"finally,omitempty,omitzero"`
}

Struct-typed fields carry omitzero next to omitempty: encoding/json ignores omitempty on structs, so without omitzero every serialized definition repeats empty objects. omitempty stays for the YAML encoder and the schema generator, which read it as "optional".

func ParseWorkflow

func ParseWorkflow(yamlStr string) (*WorkflowDefinition, error)

ParseWorkflow parses YAML string into Workflow struct

type WorkflowOptions

type WorkflowOptions struct {
	Options         client.StartWorkflowOptions `json:"options"`
	Timeout         time.Duration               `json:"timeout,omitempty"`
	ActivityOptions workflow.ActivityOptions    `json:"activityOptions"`
}

Jump to

Keyboard shortcuts

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