base-golang/pkg/trace/grpc.go
2024-07-23 10:23:43 +08:00

18 lines
777 B
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 trace
import (
"google.golang.org/grpc/metadata"
)
type Grpc struct {
Timestamp string `json:"timestamp"` // 时间格式2006-01-02 15:04:05
Addr string `json:"addr"` // 地址
Method string `json:"method"` // 操作方法
Meta metadata.MD `json:"meta"` // Mate
Request map[string]any `json:"request"` // 请求信息
Response map[string]any `json:"response"` // 返回信息
CostSeconds float64 `json:"cost_seconds"` // 执行时间(单位秒)
Code string `json:"err_code,omitempty"` // 错误码
Message string `json:"err_message,omitempty"` // 错误信息
}