task

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelMission

func CancelMission(mission *model.Task) error

func CancelMissionRecord

func CancelMissionRecord(ID string) error

func GetValueByName

func GetValueByName(name string) (string, error)

func PreviewTask added in v0.2.5

func PreviewTask(missionID string) (*types.PreviewResponse, error)

PreviewTask 用任务的当前配置跑一次预览:

  • SQL source:自动在查询外层包 LIMIT,避免全表扫描
  • 所有 sink 替换为内存 PreviewSink,不向任何外部系统写入
  • 返回前 N 行数据及列结构,供前端展示

func ReplaceVariables added in v0.2.0

func ReplaceVariables(data *types.TaskData) (*types.TaskData, error)

ReplaceVariables 对 TaskData 中所有组件的 Params.Value 执行变量替换。 只替换 Value 字段中的 ${...} 占位符,不修改 Key 和其他结构字段。 返回深拷贝后的 TaskData,不修改原始数据。

func RunMissionManual

func RunMissionManual(missionID string) error

func RunTask

func RunTask(mission model.Task, runBy string) (err error)

func ScheduleMission

func ScheduleMission(mission *model.Task) error

func SetMissions

func SetMissions()

Types

type RunState added in v0.2.0

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

RunState provides thread-safe access to task execution state, protecting the cancel function map and manual cancel map from concurrent access.

func NewRunState added in v0.2.0

func NewRunState() *RunState

func (*RunState) CancelRecord added in v0.2.0

func (rs *RunState) CancelRecord(recordID string) error

CancelRecord cancels a running task record by its ID. Returns an error if the record is not found or not cancellable.

func (*RunState) IsManualCancelled added in v0.2.0

func (rs *RunState) IsManualCancelled(recordID string) bool

IsManualCancelled checks if a task record was manually cancelled and clears the flag.

func (*RunState) RemoveCancel added in v0.2.0

func (rs *RunState) RemoveCancel(recordID string)

RemoveCancel removes the cancel function for a task record.

func (*RunState) SetCancel added in v0.2.0

func (rs *RunState) SetCancel(recordID string, cancel context.CancelFunc)

SetCancel registers a cancel function for a task record.

Jump to

Keyboard shortcuts

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