Files
orbit/pulse/model/concurrency_limit.go

23 lines
930 B
Go
Raw Permalink 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 (
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" }