feat: 增加服务运行模式定义

This commit is contained in:
2025-12-29 11:27:47 +08:00
parent de89145034
commit c3b314cb72

19
gin.go
View File

@ -40,3 +40,22 @@ const (
GinLogicAfterResponseKey = "__logic_after_response__" // gin请求成功后, 执行的逻辑
GinTraceInstanceField = "__trace_instance__" // trace实例的key
)
// Mode 服务器模式
type Mode string
func (m Mode) String() string {
return string(m)
}
func (m Mode) Value() string {
return m.String()
}
const (
ModeDefault Mode = "local" // 默认模式 - 本地开发
ModeTest Mode = "test" // 测试模式
ModeProd Mode = "prod" // 生产模式
ModePreview Mode = "preview" // 预览模式
ModeSandbox Mode = "sandbox" // 沙盒模式
)