pipeline

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline

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

Pipeline 流水线编排器

func New

func New(cfg *config.Config) *Pipeline

New 创建新的流水线

func (*Pipeline) GetAllTasks

func (p *Pipeline) GetAllTasks() []*Task

GetAllTasks 获取所有任务(扁平化)

func (*Pipeline) GetBuiltImages

func (p *Pipeline) GetBuiltImages() []string

GetBuiltImages 获取已构建的镜像列表

func (*Pipeline) GetStages

func (p *Pipeline) GetStages() []*Stage

GetStages 获取所有阶段

func (*Pipeline) Run

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

Run 运行流水线

func (*Pipeline) SetProgram

func (p *Pipeline) SetProgram(program *tea.Program)

SetProgram 设置 tea.Program 用于发送消息

type Stage

type Stage struct {
	Index    int
	ID       string
	Name     string
	Parallel bool
	Tasks    []*Task
}

Stage 流水线阶段

func NewStage

func NewStage(index int, cfg config.Stage, fullCfg *config.Config) *Stage

NewStage 创建新的阶段

func (*Stage) GetCompletedCount

func (s *Stage) GetCompletedCount() int

GetCompletedCount 获取已完成的任务数量

func (*Stage) GetTaskCount

func (s *Stage) GetTaskCount() int

GetTaskCount 获取任务数量

func (*Stage) HasFailed

func (s *Stage) HasFailed() bool

HasFailed 检查阶段是否有失败的任务

func (*Stage) IsCompleted

func (s *Stage) IsCompleted() bool

IsCompleted 检查阶段是否已完成

type Task

type Task struct {
	ID         string
	Name       string
	Type       string
	Config     config.TaskConfig
	Status     types.TaskStatus
	StartTime  time.Time
	EndTime    time.Time
	Error      error
	StageIndex int
	TaskIndex  int
}

Task 流水线任务

func NewTask

func NewTask(stageIndex, taskIndex int, cfg config.Task) *Task

NewTask 创建新的任务

func (*Task) Complete

func (t *Task) Complete()

Complete 完成任务

func (*Task) Duration

func (t *Task) Duration() time.Duration

Duration 返回任务耗时

func (*Task) Fail

func (t *Task) Fail(err error)

Fail 任务失败

func (*Task) IsCompleted

func (t *Task) IsCompleted() bool

IsCompleted 检查任务是否已完成(成功或跳过)

func (*Task) IsFailed

func (t *Task) IsFailed() bool

IsFailed 检查任务是否失败

func (*Task) IsPending

func (t *Task) IsPending() bool

IsPending 检查任务是否等待中

func (*Task) IsRunning

func (t *Task) IsRunning() bool

IsRunning 检查任务是否正在运行

func (*Task) Skip

func (t *Task) Skip()

Skip 跳过任务

func (*Task) Start

func (t *Task) Start()

Start 开始任务

func (*Task) ToTodoListTask

func (t *Task) ToTodoListTask() interface{}

ToTodoListTask 转换为 TodoList 任务

Jump to

Keyboard shortcuts

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