feat: establish Orbit models, migrations and development baseline
This commit is contained in:
22
pulse/model/concurrency_limit.go
Normal file
22
pulse/model/concurrency_limit.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
)
|
||||
|
||||
// ConcurrencyLimit 表示跨节点共享的并发限制,实际额度更新必须处于事务内。
|
||||
// 对应表 pulse_concurrency_limits;这是服务端持久化模型,不直接作为 API 响应。
|
||||
type ConcurrencyLimit struct {
|
||||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||||
core.Record
|
||||
// ScopeKey 资源作用域标识;空字符串表示当前操作的默认作用域。
|
||||
ScopeKey string `db:"scope_key"`
|
||||
// KeyDigest 稳定幂等键或资源键的 SHA-256 摘要。
|
||||
KeyDigest core.Digest `db:"key_digest"`
|
||||
// MaxPermits 该共享资源允许占用的许可上限。
|
||||
MaxPermits uint32 `db:"max_permits"`
|
||||
// UsedPermits 已占用的有效许可数,必须与许可记录同事务维护。
|
||||
UsedPermits uint32 `db:"used_permits"`
|
||||
}
|
||||
|
||||
func (ConcurrencyLimit) TableName() string { return "pulse_concurrency_limits" }
|
||||
Reference in New Issue
Block a user