Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertMessage ¶
type AlertMessage struct {
ProjectName string `json:"project_name"` // 项目名,用于区分不同项目告警信息
Env string `json:"env"` // 运行环境
TraceID string `json:"trace_id"` // 唯一ID,用于追踪关联
HOST string `json:"host"` // 请求 HOST
URI string `json:"uri"` // 请求 URI
Method string `json:"method"` // 请求 Method
ErrorMessage interface{} `json:"error_message"` // 错误信息
ErrorStack string `json:"error_stack"` // 堆栈信息
Timestamp time.Time `json:"timestamp"` // 时间戳
}
AlertMessage 告警信息
type MetricsMessage ¶
type MetricsMessage struct {
ProjectName string `json:"project_name"` // 项目名,用于区分不同项目告警信息
Env string `json:"env"` // 运行环境
TraceID string `json:"trace_id"` // 唯一ID,用于追踪关联
HOST string `json:"host"` // 请求 HOST
Path string `json:"path"` // 请求 Path
Method string `json:"method"` // 请求 Method
HTTPCode int `json:"http_code"` // HTTP 状态码
BusinessCode int `json:"business_code"` // 业务码
CostSeconds float64 `json:"cost_seconds"` // 耗时,单位:秒
IsSuccess bool `json:"is_success"` // 状态,是否成功
}
MetricsMessage 指标信息
func (*MetricsMessage) Marshal ¶
func (m *MetricsMessage) Marshal() (jsonRaw []byte)
Marshal 序列化到JSON
type SessionUserInfo ¶
type SessionUserInfo struct {
UserID int32 `json:"user_id"` // 用户ID
UserName string `json:"user_name"` // 用户名
}
SessionUserInfo 当前用户会话信息
func (*SessionUserInfo) Marshal ¶
func (user *SessionUserInfo) Marshal() (jsonRaw []byte)
Marshal 序列化到JSON
Click to show internal directories.
Click to hide internal directories.