package zapx import "time" // 消息队列名称 const ( QueueOperateRecord = "clickhouse_operation" // 操作记录队列 QueueLogRecord = "clickhouse_log" // 日志记录队列 ) // StringEntry 字符串键值对 type StringEntry struct { Key string `json:"key"` // 键 Value string `json:"value"` // 值 } // FloatEntry 浮点数键值对 type FloatEntry struct { Key string `json:"key"` // 键 Value float64 `json:"value"` // 值 } // IntEntry 整数键值对 type IntEntry struct { Key string `json:"key"` // 键 Value int32 `json:"value"` // 值 } // BoolEntry 布尔键值对 type BoolEntry struct { Key string `json:"key"` // 键 Value bool `json:"value"` // 值 } // LogRecord 定义结构化日志记录的数据结构。 // 因为结构化日志允许重复的键值对,所以使用切片类型模拟字典。 // 不支持嵌套类型。嵌套类型可使用 json path 做 key。如 "a.b[1].c"。 type LogRecord struct { EventTime time.Time `json:"eventTime"` // 日志时间。必填。 Category string `json:"category"` // 工程分类。必填。 Level string `json:"level"` // 日志等级 Caller string `json:"caller"` // 日志调用位置 Message string `json:"message"` // 日志消息 StringEntries []StringEntry `json:"stringEntries"` // 字符串键值对 FloatEntries []FloatEntry `json:"floatEntries"` // 浮点数键值对 IntEntries []IntEntry `json:"intEntries"` // 整数键值对 BoolEntries []BoolEntry `json:"boolEntries"` // 布尔键值对 }