Files
orbit/platform/model/namespace.go

31 lines
1.1 KiB
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"
)
// Namespace 表示应用在指定环境中的资源隔离边界。
// 对应表 orbit_namespaces;这是服务端持久化模型,不直接作为 API 响应。
type Namespace struct {
// ID 命名空间标识,全局唯一。
ID core.ID `db:"id"`
// Revision 乐观并发版本,从 1 开始;更新时必须核对预期版本。
Revision uint64 `db:"revision"`
// CreatedAt 创建时间,统一 UTC,数据库精度为微秒。
CreatedAt time.Time `db:"created_at"`
// UpdatedAt 最后写入时间,统一 UTC;不能代替并发版本。
UpdatedAt time.Time `db:"updated_at"`
// ApplicationID 所属应用标识。
ApplicationID core.ID `db:"application_id"`
// Name 可读名称,唯一性范围由对应数据表约束。
Name string `db:"name"`
// Environment 环境标识,用于区分开发、测试和生产等隔离范围。
Environment string `db:"environment"`
// Enabled 是否启用;关闭后拒绝相应的新接入或新操作。
Enabled bool `db:"enabled"`
}
func (Namespace) TableName() string { return "orbit_namespaces" }