Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StateMap = map[State]string{ StateStopped: "stopped", StateRunning: "running", StateFailed: "failed", StateUnknown: "unknown", StatePending: "pending", StatePaused: "paused", StateSkipped: "skipped", }
Functions ¶
Types ¶
type SBase ¶
type SReplay ¶
type SReplay struct {
SBase
Date string `json:"date" gorm:"size:10;not null;index:idx_replay_order,priority:1;comment:录像日期"`
ReplayID string `json:"replay_id" gorm:"size:36;not null;uniqueIndex;index:idx_replay_order,priority:2;comment:录像标识"`
FilePath string `json:"file_path" gorm:"size:1024;not null;comment:录像文件相对路径"`
Size int64 `json:"size" gorm:"not null;comment:压缩文件大小"`
}
SReplay records the database identity of a finalized terminal recording and the file containing its cast data. Keeping this mapping in the database allows replay listings to be paginated without scanning the replay directory on every request.
type SStep ¶
type SStep struct {
SBase
TaskID uuid.UUID `json:"task_id" gorm:"not null;uniqueIndex:idx_task_id_step_name"`
Task *STask `json:"-" gorm:"foreignKey:TaskID;references:ID;constraint:OnDelete:CASCADE"`
Name string `json:"name,omitempty" gorm:"size:256;uniqueIndex:idx_task_id_step_name;not null;comment:名称"`
Desc string `json:"desc,omitempty" gorm:"comment:描述"`
Kind string `json:"kind,omitempty" gorm:"size:256;index;not null;comment:类型"`
Content string `json:"content,omitempty" gorm:"comment:内容"`
Options datatypes.JSON `json:"options" gorm:"column:options;comment:执行器私有参数"`
Routing datatypes.JSONType[*iproto.SStepRouting] `json:"routing" gorm:"column:routing;comment:DAG依赖边、汇合策略与成功标签"`
RetryPolicy datatypes.JSONType[*iproto.SRetryPolicy] `json:"retry_policy" gorm:"comment:重试策略"`
Timeout time.Duration `json:"timeout,omitempty" gorm:"not null;default:86400000000000;comment:超时时间"`
SStepUpdate
}
type SStepEnv ¶
type SStepLog ¶
type SStepLog struct {
SBase
StepID uuid.UUID `json:"step_id" gorm:"not null;uniqueIndex:idx_step_log_line"`
Step *SStep `json:"-" gorm:"foreignKey:StepID;references:ID;constraint:OnDelete:CASCADE"`
Timestamp int64 `json:"timestamp,omitempty" gorm:"not null;comment:时间戳"`
Line *int64 `json:"line,omitempty" gorm:"not null;uniqueIndex:idx_step_log_line;comment:行号"`
Content string `json:"content,omitempty" gorm:"comment:内容"`
}
type SStepUpdate ¶
type SStepUpdate struct {
Message string `json:"message,omitempty" gorm:"comment:消息"`
State *State `json:"state,omitempty" gorm:"index;not null;default:0;comment:状态"`
OldState *State `json:"old_state,omitempty" gorm:"index;not null;default:0;comment:旧状态"`
Code *api.ExecCode `json:"code,omitempty" gorm:"index;not null;default:0;comment:退出码"`
STime *time.Time `json:"s_time,omitempty" gorm:"comment:开始时间"`
ETime *time.Time `json:"e_time,omitempty" gorm:"comment:结束时间"`
}
func (*SStepUpdate) ETimeStr ¶
func (s *SStepUpdate) ETimeStr() string
func (*SStepUpdate) STimeStr ¶
func (s *SStepUpdate) STimeStr() string
type STask ¶
type STask struct {
SBase
Name string `json:"name,omitempty" gorm:"size:256;uniqueIndex;not null;comment:名称"`
Workdir string `json:"workdir,omitempty" gorm:"size:256;not null;comment:工作路径(相对路径)"`
Timeout time.Duration `json:"timeout,omitempty" gorm:"not null;default:86400000000000;comment:超时时间"`
Cleanup bool `json:"cleanup,omitempty" gorm:"not null;default:false;comment:任务结束后是否清理工作目录,默认保留"`
STaskUpdate
}
type STaskEnv ¶
type STaskUpdate ¶
type STaskUpdate struct {
Message string `json:"message,omitempty" gorm:"comment:消息"`
State *State `json:"state,omitempty" gorm:"index;not null;default:0;comment:状态"`
OldState *State `json:"old_state,omitempty" gorm:"index;not null;default:0;comment:旧状态"`
STime *time.Time `json:"s_time,omitempty" gorm:"comment:开始时间"`
ETime *time.Time `json:"e_time,omitempty" gorm:"comment:结束时间"`
}
func (*STaskUpdate) ETimeStr ¶
func (t *STaskUpdate) ETimeStr() string
func (*STaskUpdate) STimeStr ¶
func (t *STaskUpdate) STimeStr() string