feat: establish Orbit models, migrations and development baseline
This commit is contained in:
24
pulse/model/queue.go
Normal file
24
pulse/model/queue.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
)
|
||||
|
||||
// Queue 表示任务路由与资源控制队列,不要求每个租户单独创建队列。
|
||||
// 对应表 pulse_queues;这是服务端持久化模型,不直接作为 API 响应。
|
||||
type Queue struct {
|
||||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||||
core.Record
|
||||
// Name 可读名称,唯一性范围由对应数据表约束。
|
||||
Name string `db:"name"`
|
||||
// Paused 暂停标记;停止新的受控工作,不表示在途请求已停止。
|
||||
Paused bool `db:"paused"`
|
||||
// MaxConcurrency 允许同时持有的有效执行许可上限,必须大于零。
|
||||
MaxConcurrency uint32 `db:"max_concurrency"`
|
||||
// RatePerSecond 每秒新执行的速率配置;实际限流由共享协调逻辑落实。
|
||||
RatePerSecond uint32 `db:"rate_per_second"`
|
||||
// Policy 队列资源与执行配置的 JSON 文档。
|
||||
Policy core.JSON `db:"policy"`
|
||||
}
|
||||
|
||||
func (Queue) TableName() string { return "pulse_queues" }
|
||||
Reference in New Issue
Block a user