dag

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodecBlockExtractor

type CodecBlockExtractor struct {
	// contains filtered or unexported fields
}

CodecBlockExtractor 代码块提取器 只识别 ```flowx-yaml 代码块,支持行尾注释提取 description

func NewCodecBlockExtractor

func NewCodecBlockExtractor(maxSize int) *CodecBlockExtractor

NewCodecBlockExtractor 创建代码块提取器

func (*CodecBlockExtractor) Extract

func (e *CodecBlockExtractor) Extract(output string) (map[string]core.FieldItem, error)

Extract 从输出中提取代码块 解析 ```flowx-yaml 代码块,提取行尾注释作为 description

type DGAEdge

type DGAEdge struct {
	// contains filtered or unexported fields
}

DGAEdge 是Edge接口的实现

func (*DGAEdge) Evaluate

func (e *DGAEdge) Evaluate(ctx EvaluationContext) (bool, error)

Evaluate 评估条件表达式 如果表达式为空,返回true(无条件边总是可以通过) 如果有表达式但没有设置模板引擎,使用默认的Pongo2模板引擎

func (*DGAEdge) Expression

func (e *DGAEdge) Expression() string

Expression 返回边的条件表达式

func (*DGAEdge) ID

func (e *DGAEdge) ID() string

ID 返回边的唯一标识符

func (*DGAEdge) SetEngine

func (e *DGAEdge) SetEngine(engine template.TemplateEngine)

SetEngine 设置模板引擎(用于延迟初始化)

func (*DGAEdge) Source

func (e *DGAEdge) Source() Node

Source 返回边的源节点

func (*DGAEdge) Target

func (e *DGAEdge) Target() Node

Target 返回边的目标节点

type DGAEvaluationContext

type DGAEvaluationContext struct {
	// contains filtered or unexported fields
}

DGAEvaluationContext 是EvaluationContext接口的实现

func (*DGAEvaluationContext) All

func (c *DGAEvaluationContext) All() map[string]any

All 返回上下文中所有数据的副本 合并了:基础数据、节点数据、流水线数据 将 "NodeID.key" 格式的扁平键转换为嵌套结构

func (*DGAEvaluationContext) Get

func (c *DGAEvaluationContext) Get(key string) (any, bool)

Get 从上下文中获取值

func (*DGAEvaluationContext) Iteration

func (c *DGAEvaluationContext) Iteration() int

Iteration 返回当前迭代计数器值

func (*DGAEvaluationContext) WithIteration

func (c *DGAEvaluationContext) WithIteration(iteration int) EvaluationContext

WithIteration 设置迭代计数器并返回新的上下文(链式调用)

func (*DGAEvaluationContext) WithNode

func (c *DGAEvaluationContext) WithNode(node Node) EvaluationContext

WithNode 设置当前节点并返回新的上下文(链式调用)

func (*DGAEvaluationContext) WithParams

func (c *DGAEvaluationContext) WithParams(params map[string]any) EvaluationContext

WithParams 添加参数到上下文并返回新的上下文(链式调用)

func (*DGAEvaluationContext) WithWorkflow added in v0.3.1

func (c *DGAEvaluationContext) WithWorkflow(workflow Workflow) EvaluationContext

WithWorkflow 设置流水线并返回新的上下文(链式调用)

type DGAGraph

type DGAGraph struct {
	// contains filtered or unexported fields
}

保存了流水线的图结构

func NewDGAGraph

func NewDGAGraph() *DGAGraph

func (*DGAGraph) AddEdge

func (dga *DGAGraph) AddEdge(edge Edge) error

AddEdge 向图中添加边

func (*DGAGraph) AddEntryNode

func (dga *DGAGraph) AddEntryNode(nodeID string)

addEntryNode 添加入口节点(从 [*] 指向的节点)

func (*DGAGraph) AddExitNode

func (dga *DGAGraph) AddExitNode(nodeID string)

addExitNode 添加出口节点(指向 [*] 的节点)

func (*DGAGraph) AddVertex

func (dga *DGAGraph) AddVertex(node Node)

AddVertex 向图中添加顶点(节点) 检查是否存在循环;如果存在循环,则返回 core.ErrHasCycle 否则返回 nil

func (*DGAGraph) BackEdges

func (dga *DGAGraph) BackEdges() []Edge

BackEdges 返回所有被接受的回边

func (*DGAGraph) Edges

func (dga *DGAGraph) Edges() []Edge

Edges 返回所有的边

func (*DGAGraph) EntryNodes

func (dga *DGAGraph) EntryNodes() []string

EntryNodes 返回入口节点列表

func (*DGAGraph) ExitNodes

func (dga *DGAGraph) ExitNodes() []string

ExitNodes 返回出口节点列表

func (*DGAGraph) GetEdge

func (dga *DGAGraph) GetEdge(srcID, destID string) (Edge, bool)

GetEdge 根据源节点和目标节点ID查找边

func (*DGAGraph) GetNode

func (dga *DGAGraph) GetNode(nodeID string) (Node, bool)

GetNode 根据节点ID查找节点

func (*DGAGraph) HasCycle

func (dga *DGAGraph) HasCycle() bool

HasCycle 检查图中是否存在循环

func (*DGAGraph) IncomingEdges

func (dga *DGAGraph) IncomingEdges(nodeID string) []Edge

IncomingEdges 返回指向指定节点的所有边

func (*DGAGraph) IsCyclic

func (dga *DGAGraph) IsCyclic() bool

IsCyclic 返回图是否有被接受的回边(条件循环节点)

func (*DGAGraph) LoopExitNodeSet

func (dga *DGAGraph) LoopExitNodeSet(backEdges []Edge) map[string]bool

LoopExitNodeSet 计算循环出口下游节点集合: 从回边 source 沿正向边可达、但不属于任何循环体的节点。 这些节点应在循环条件不满足退出后再执行,而非循环迭代期间反复执行

func (*DGAGraph) LoopNodeSet

func (dga *DGAGraph) LoopNodeSet(backEdge Edge) map[string]bool

LoopNodeSet 计算回边涉及的循环节点集合 循环体 = 从回边 target 沿正向边可达、且能沿正向边到达 source 的节点集合 (循环出口下游节点如 source 之后的 tail 链不在集合内,不会被重置重跑)

func (*DGAGraph) Nodes

func (dga *DGAGraph) Nodes() map[string]Node

Nodes 返回所有的节点map

func (*DGAGraph) OutgoingEdges

func (dga *DGAGraph) OutgoingEdges(nodeID string) []Edge

OutgoingEdges 返回从指定节点出发的所有边

func (*DGAGraph) RemoveEdge

func (dga *DGAGraph) RemoveEdge(srcID, destID string) error

RemoveEdge 删除指定的边

func (*DGAGraph) RemoveVertex

func (dga *DGAGraph) RemoveVertex(nodeID string) error

RemoveVertex 删除节点及其所有关联边

func (*DGAGraph) Traversal

func (dga *DGAGraph) Traversal(ctx context.Context, evalCtx EvaluationContext, fn TraversalFn) error

Traversal 对图执行广度优先遍历 为图中的每个节点执行提供的 TraversalFn 函数 支持有环图和无环图:使用 forwardGraph(排除回边)计算层级 同一层级内的节点并发执行,层级之间串行执行

func (*DGAGraph) TraversalSteps

func (dga *DGAGraph) TraversalSteps(evalCtx EvaluationContext) [][]string

TraversalSteps 计算 BFS 层级执行计划 返回 [][]string,每个子切片是一层可并发执行的节点ID列表

type DGANode

type DGANode struct {
	// contains filtered or unexported fields
}

func NewDGANode

func NewDGANode(id, state string) *DGANode

NewDGANode creates a new DGANode with the specified id and state, initializing an empty property map.

func NewDGANodeWithConfig

func NewDGANodeWithConfig(id, state, executor, image string, steps []core.Step, config map[string]any) *DGANode

NewDGANodeWithConfig creates a new DGANode with full configuration.

func (*DGANode) EnsureIds

func (dgaNode *DGANode) EnsureIds()

EnsureIds 确保节点和步骤都有ID

func (*DGANode) Get

func (dgaNode *DGANode) Get(key string) string

func (*DGANode) GetConfig

func (dgaNode *DGANode) GetConfig() map[string]any

func (*DGANode) GetExecutor

func (dgaNode *DGANode) GetExecutor() string

func (*DGANode) GetRuntimeStatus

func (dgaNode *DGANode) GetRuntimeStatus() *core.NodeRuntimeStatus

GetRuntimeStatus 获取运行时状态的深拷贝

func (*DGANode) GetStepRuntimeStatus

func (dgaNode *DGANode) GetStepRuntimeStatus(stepName string) *core.StepRuntimeStatus

GetStepRuntimeStatus 获取指定步骤的运行时状态(拷贝)

func (*DGANode) GetSteps

func (dgaNode *DGANode) GetSteps() []core.Step

func (*DGANode) Id

func (dgaNode *DGANode) Id() string

func (*DGANode) Set

func (dgaNode *DGANode) Set(key string, value any)

func (*DGANode) SetRuntimeStatus

func (dgaNode *DGANode) SetRuntimeStatus(status *core.NodeRuntimeStatus)

SetRuntimeStatus 设置运行时状态

func (*DGANode) SetStepRuntimeStatus

func (dgaNode *DGANode) SetStepRuntimeStatus(stepStatus *core.StepRuntimeStatus)

SetStepRuntimeStatus 设置步骤运行时状态

func (*DGANode) Status

func (dgaNode *DGANode) Status() string

func (*DGANode) WorkflowId added in v0.3.1

func (dgaNode *DGANode) WorkflowId() string

type Edge

type Edge interface {
	// Source 返回边的源节点
	Source() Node
	// Target 返回边的目标节点
	Target() Node
	// Expression 返回边的条件表达式(pongo2模板语法)
	// 如果返回空字符串,表示无条件边,总是可以遍历
	Expression() string
	// Evaluate 评估条件表达式,返回bool表示是否通过
	Evaluate(ctx EvaluationContext) (bool, error)
	// ID 返回边的唯一标识符(格式:source->target)
	ID() string
}

Edge 表示DAG中的边,支持条件表达式

func NewConditionalEdge

func NewConditionalEdge(source, target Node, expression string) Edge

NewConditionalEdge 创建一条条件边

func NewDGAEdge

func NewDGAEdge(source, target Node) Edge

NewDGAEdge 创建一条无条件边

type EdgeModification

type EdgeModification struct {
	Source     string `yaml:"source"`
	Target     string `yaml:"target"`
	Expression string `yaml:"expression,omitempty"`
}

EdgeModification 表示一条要添加的边

type EdgeRemoval

type EdgeRemoval struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

EdgeRemoval 表示一条要删除的边

type EvaluationContext

type EvaluationContext interface {
	Get(key string) (any, bool)
	All() map[string]any
	WithNode(node Node) EvaluationContext
	WithWorkflow(workflow Workflow) EvaluationContext
	WithParams(params map[string]any) EvaluationContext
	WithIteration(iteration int) EvaluationContext
	Iteration() int
}

EvaluationContext 表达式求值上下文

func NewEvaluationContext

func NewEvaluationContext() EvaluationContext

NewEvaluationContext 创建一个新的求值上下文

type Event

type Event string

流水线事件

var (
	//监听事件
	WorkflowInit                Event = core.EventWorkflowInit                // 流水线初始化
	WorkflowStart               Event = core.EventWorkflowStart               // 流水线开始执行
	WorkflowFinish              Event = core.EventWorkflowFinish              // 流水线完成
	WorkflowExecutorPrepare     Event = core.EventWorkflowExecutorPrepare     // 流水线执行器开始准备
	WorkflowExecutorPrepareDone Event = core.EventWorkflowExecutorPrepareDone // 流水线执行器准备完毕
	WorkflowNodeStart           Event = core.EventWorkflowNodeStart           // 节点开始
	WorkflowNodeFinish          Event = core.EventWorkflowNodeFinish          // 节点完成
	WorkflowNodeFailed          Event = core.EventWorkflowNodeFailed          // 节点执行失败
	WorkflowPaused              Event = core.EventWorkflowPaused              // 流水线暂停
	WorkflowResumed             Event = core.EventWorkflowResumed             // 流水线恢复
	WorkflowGraphModified       Event = core.EventWorkflowGraphModified       // 图被修改
)

type ExecutorProvider

type ExecutorProvider = executor.ExecutorProvider

ExecutorProvider Executor提供者接口 从executor/core导入

type Graph

type Graph interface {
	GraphReader
	//AddVertex 添加顶点
	AddVertex(node Node)
	//AddEdge 添加边
	AddEdge(edge Edge) error
	//RemoveVertex 删除节点及其所有关联边
	RemoveVertex(nodeID string) error
	//RemoveEdge 删除指定的边
	RemoveEdge(srcID, destID string) error
	//HasCycle 检查图中是否存在环
	HasCycle() bool
}

type GraphModifications

type GraphModifications struct {
	// AddNodes 要添加的节点配置列表
	AddNodes []core.NodeConfig `yaml:"addNodes"`
	// RemoveNodes 要删除的节点 ID 列表(同时删除关联边)
	RemoveNodes []string `yaml:"removeNodes"`
	// AddEdges 要添加的边列表
	AddEdges []EdgeModification `yaml:"addEdges"`
	// RemoveEdges 要删除的边列表
	RemoveEdges []EdgeRemoval `yaml:"removeEdges"`
	// AddGraph 可选的 Mermaid stateDiagram-v2 片段,用于批量添加边
	AddGraph string `yaml:"addGraph"`
}

GraphModifications 表示一组要原子应用的图修改操作

func (GraphModifications) IsEmpty

func (m GraphModifications) IsEmpty() bool

IsEmpty 判断修改集是否为空

type GraphReader

type GraphReader interface {
	//Nodes
	Nodes() map[string]Node
	//Edges 返回所有的边
	Edges() []Edge
	//Traversal 遍历图结构
	Traversal(ctx context.Context, evalCtx EvaluationContext, fn TraversalFn) error
	//GetNode 根据节点ID查找节点
	GetNode(nodeID string) (Node, bool)
	//GetEdge 根据源节点和目标节点ID查找边
	GetEdge(srcID, destID string) (Edge, bool)
	//IncomingEdges 返回指向指定节点的所有边
	IncomingEdges(nodeID string) []Edge
	//OutgoingEdges 返回从指定节点出发的所有边
	OutgoingEdges(nodeID string) []Edge
}

type Listener

type Listener interface {
	// 处理对应的事件将事件发生的对应的流水线和对应的事件作为参数传入
	Handle(p Workflow, event Event)
	// 获取当前注册的Event
	Events() []Event
}

我们将整个流水线的运行过程中的事件抽象成对应的Event 这样我们就能再外部监听Event

type ListeningFn

type ListeningFn func(p Workflow)

WorkflowListeningFn 流水线监听函数

type Metadata

type Metadata map[string]core.FieldItem

type Node

type Node interface {
	//ID 获取节点唯一id
	Id() string
	//WorkflowId 获取节点所属的流水线id
	WorkflowId() string
	//Status 获取节点状态
	Status() string
	//Get 获取节点属性数据
	Get(key string) string
	// Set 设置节点属性数据
	Set(key string, value any)
	// GetExecutor 获取节点执行器名称
	GetExecutor() string
	// GetSteps 获取节点执行步骤
	GetSteps() []core.Step
	// GetConfig 获取节点配置
	GetConfig() map[string]any
	// 运行时状态管理
	GetRuntimeStatus() *core.NodeRuntimeStatus
	SetRuntimeStatus(status *core.NodeRuntimeStatus)
	// 步骤状态管理
	GetStepRuntimeStatus(stepName string) *core.StepRuntimeStatus
	SetStepRuntimeStatus(stepStatus *core.StepRuntimeStatus)
	// 初始化ID
	EnsureIds()
}

type OutputExtractor

type OutputExtractor interface {
	// Extract 从命令输出中提取数据
	// output: 命令完整输出
	// 返回: 提取的键值对(值为 FieldItem)
	Extract(output string) (map[string]core.FieldItem, error)
}

OutputExtractor 输出提取器接口

type RegexExtractor

type RegexExtractor struct {
	// contains filtered or unexported fields
}

RegexExtractor 正则表达式提取器

func NewRegexExtractor

func NewRegexExtractor(patterns map[string]string, maxSize int) (*RegexExtractor, error)

NewRegexExtractor 创建正则表达式提取器

func (*RegexExtractor) Extract

func (e *RegexExtractor) Extract(output string) (map[string]core.FieldItem, error)

Extract 使用正则表达式从输出中提取数据 返回值为 FieldItem,Description 和 SrcNode 由调用方设置

type Snapshotter

type Snapshotter interface {
	// TakeSnapshot 从 Workflow 生成带状态的配置
	TakeSnapshot(workflow Workflow, originalConfig *core.WorkflowConfig) (*core.WorkflowConfig, error)
	// ToYAML 将配置转换为 YAML
	ToYAML(config *core.WorkflowConfig) (string, error)
}

Snapshotter 状态快照接口

type TraversalFn

type TraversalFn func(ctx context.Context, node Node) error

type Workflow added in v0.3.1

type Workflow interface {
	//ID 流水线的id
	Id() string
	//GetGraph 返回图结构
	GetGraph() Graph
	//SetGraph 设置图结构
	SetGraph(graph Graph)
	//Status 返回流水线的整体状态
	Status() string
	//SetMetadata 设置元数据
	SetMetadata(store metadata.MetadataStore)
	//Metadata 获取元数据
	Metadata() Metadata
	//Listening 流水线执行事件监听设置
	Listening(listener Listener)
	//Done流水线是否执行完成
	Done() <-chan struct{}
	//Run执行流水线
	Run(ctx context.Context) error
	//Notify 执行的步骤通知流水线
	Notify()
	//Cancel 取消流水线
	Cancel()
	//SetExecutorProvider 设置Executor提供者
	SetExecutorProvider(provider ExecutorProvider)
	//SetTemplateEngine 设置模板引擎
	SetTemplateEngine(engine template.TemplateEngine)
	//GetTemplateEngine 获取模板引擎
	GetTemplateEngine() template.TemplateEngine
	//SetPusher 设置日志推送器
	SetPusher(pusher logger.Pusher)
	//SetParam 设置参数
	SetParam(param map[string]interface{})
	//GetParam 获取参数
	GetParam() Metadata
	//Pause 暂停流水线,等待当前层执行完成后暂停
	Pause() error
	//Resume 恢复暂停的流水线
	Resume(ctx context.Context) error
	//IsModifiable 判断当前是否可修改图
	IsModifiable() bool
	//CurrentNode 返回当前正在执行的节点(如有)
	CurrentNode() Node
}

func NewWorkflow added in v0.3.1

func NewWorkflow(ctx context.Context) Workflow

func NewWorkflowWithId added in v0.3.1

func NewWorkflowWithId(ctx context.Context, id string) Workflow

NewWorkflowWithId 使用指定 ID 创建流水线;id 为空时退回随机 UUID。 宿主(如 flowx-studio)可传入稳定的外部身份(执行实例 ID),使同一执行的 续跑/重入保持同一 FLOWX_WORKFLOW_ID,节点可据此做按执行隔离的状态持久化。

type WorkflowImpl added in v0.3.1

type WorkflowImpl struct {
	// contains filtered or unexported fields
}

func (*WorkflowImpl) Cancel added in v0.3.1

func (p *WorkflowImpl) Cancel()

Cancel 终止流水线

func (*WorkflowImpl) CurrentNode added in v0.3.1

func (p *WorkflowImpl) CurrentNode() Node

CurrentNode 返回当前正在执行的节点(如有)

func (*WorkflowImpl) DeriveStatusFromNodes added in v0.3.1

func (p *WorkflowImpl) DeriveStatusFromNodes()

DeriveStatusFromNodes 根据节点运行时状态推导流水线状态。 用于加载携带运行时状态的快照配置(LoadWorkflow)后恢复可修改状态: 有 FAILED 节点 → FAILED;有未终结节点 → STOPPED;全部成功 → SUCCESS。

func (*WorkflowImpl) Done added in v0.3.1

func (p *WorkflowImpl) Done() <-chan struct{}

Done 返回一个通道,用于通知流水线何时完成

func (*WorkflowImpl) DoneChanForTest added in v0.3.1

func (p *WorkflowImpl) DoneChanForTest() chan struct{}

DoneChanForTest returns the doneChan for testing purposes.

func (*WorkflowImpl) GetExecutorProvider added in v0.3.1

func (p *WorkflowImpl) GetExecutorProvider() ExecutorProvider

GetExecutorProvider 返回当前的 Executor 提供者

func (*WorkflowImpl) GetGraph added in v0.3.1

func (p *WorkflowImpl) GetGraph() Graph

GetGraph 返回流水线的图结构

func (*WorkflowImpl) GetParam added in v0.3.1

func (p *WorkflowImpl) GetParam() Metadata

GetParam 获取渲染后的 param 值

func (*WorkflowImpl) GetTemplateEngine added in v0.3.1

func (p *WorkflowImpl) GetTemplateEngine() template.TemplateEngine

GetTemplateEngine 获取模板引擎

func (*WorkflowImpl) Id added in v0.3.1

func (p *WorkflowImpl) Id() string

Id 返回流水线的ID

func (*WorkflowImpl) IsModifiable added in v0.3.1

func (p *WorkflowImpl) IsModifiable() bool

IsModifiable 判断当前是否可修改图

func (*WorkflowImpl) Listening added in v0.3.1

func (p *WorkflowImpl) Listening(fn Listener)

Listening 设置流水线执行事件监听器

func (*WorkflowImpl) Metadata added in v0.3.1

func (p *WorkflowImpl) Metadata() Metadata

Metadata 获取流水线的元数据

func (*WorkflowImpl) Notify added in v0.3.1

func (p *WorkflowImpl) Notify()

Notify 这个主要是在运行过程中节点状态或者流水线状态变化,就会触发这个函数 节点 我们就可以在这里做一些处理 执行ListeningFn函数

func (*WorkflowImpl) NotifyEvent added in v0.3.1

func (p *WorkflowImpl) NotifyEvent(event Event)

NotifyEvent 通知监听器特定事件

func (*WorkflowImpl) NotifyEventForNode added in v0.3.1

func (p *WorkflowImpl) NotifyEventForNode(event Event, node Node)

NotifyEventForNode 通知与特定节点关联的事件。 并行执行时 p.currentNode 会被多个 goroutine 交替覆盖/清空, 直接在快照上指定节点,避免监听器经 CurrentNode() 拿到错乱的节点。

func (*WorkflowImpl) ParamForTest added in v0.3.1

func (p *WorkflowImpl) ParamForTest() map[string]core.FieldItem

ParamForTest returns the workflow param for testing purposes.

func (*WorkflowImpl) Pause added in v0.3.1

func (p *WorkflowImpl) Pause() error

Pause 暂停流水线,等待当前层执行完成后暂停

func (*WorkflowImpl) Resume added in v0.3.1

func (p *WorkflowImpl) Resume(ctx context.Context) error

Resume 恢复暂停的流水线

func (*WorkflowImpl) Run added in v0.3.1

func (p *WorkflowImpl) Run(ctx context.Context) error

Run 执行流水线

func (*WorkflowImpl) SetExecutorProvider added in v0.3.1

func (p *WorkflowImpl) SetExecutorProvider(provider ExecutorProvider)

SetExecutorProvider 设置Executor提供者

func (*WorkflowImpl) SetGraph added in v0.3.1

func (p *WorkflowImpl) SetGraph(graph Graph)

SetGraph 设置流水线的图结构

func (*WorkflowImpl) SetMaxLoopIterations added in v0.3.1

func (p *WorkflowImpl) SetMaxLoopIterations(max int)

SetMaxLoopIterations 设置循环图最大迭代次数

func (*WorkflowImpl) SetMetadata added in v0.3.1

func (p *WorkflowImpl) SetMetadata(store metadata.MetadataStore)

SetMetadata 设置流水线的元数据存储

func (*WorkflowImpl) SetParam added in v0.3.1

func (p *WorkflowImpl) SetParam(param map[string]interface{})

SetParam 设置 param 值

func (*WorkflowImpl) SetParamForTest added in v0.3.1

func (p *WorkflowImpl) SetParamForTest(param map[string]interface{})

SetParamForTest sets the workflow param for testing purposes.

func (*WorkflowImpl) SetPusher added in v0.3.1

func (p *WorkflowImpl) SetPusher(pusher logger.Pusher)

SetPusher 设置日志推送器

func (*WorkflowImpl) SetStatusForTest added in v0.3.1

func (p *WorkflowImpl) SetStatusForTest(status string)

SetStatusForTest sets the workflow status for testing purposes. This is intentionally exported to allow integration tests in other packages to set up specific workflow states without modifying the production API.

func (*WorkflowImpl) SetTemplateEngine added in v0.3.1

func (p *WorkflowImpl) SetTemplateEngine(engine template.TemplateEngine)

SetTemplateEngine 设置模板引擎

func (*WorkflowImpl) Status added in v0.3.1

func (p *WorkflowImpl) Status() string

Status 返回流水线的整体状态

type WorkflowSnapshotter added in v0.3.1

type WorkflowSnapshotter struct{}

WorkflowSnapshotter 实现

func NewWorkflowSnapshotter added in v0.3.1

func NewWorkflowSnapshotter() *WorkflowSnapshotter

func (*WorkflowSnapshotter) TakeSnapshot added in v0.3.1

func (ps *WorkflowSnapshotter) TakeSnapshot(workflow Workflow, originalConfig *core.WorkflowConfig) (*core.WorkflowConfig, error)

TakeSnapshot 将当前状态序列化为 WorkflowConfig

func (*WorkflowSnapshotter) ToYAML added in v0.3.1

func (ps *WorkflowSnapshotter) ToYAML(config *core.WorkflowConfig) (string, error)

ToYAML 将配置转换为 YAML

Jump to

Keyboard shortcuts

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