Files
orbit/pulse/model/schedule.go

25 lines
905 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import (
"time"
core "git.yuntuo.hk/k2safe/orbit/model"
)
// Schedule 表示调度计划的当前控制状态,规则内容由不可变版本保存。
// 对应表 pulse_schedules;这是服务端持久化模型,不直接作为 API 响应。
type Schedule struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// Name 可读名称,唯一性范围由对应数据表约束。
Name string `db:"name"`
// CurrentVersion 当前生效的计划版本号,发布时与版本记录原子更新。
CurrentVersion uint64 `db:"current_version"`
// Paused 暂停标记;停止新的受控工作,不表示在途请求已停止。
Paused bool `db:"paused"`
// NextFireAt 下一计划触发时间;没有后续触发时为空。
NextFireAt *time.Time `db:"next_fire_at"`
}
func (Schedule) TableName() string { return "pulse_schedules" }