Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct {
Method string `json:"method"` // HTTP 方法
Path string `json:"path"` // 请求路径
Query string `json:"query"` // 查询参数
IP string `json:"ip"` // 客户端 IP
UserID string `json:"user_id"` // 用户 ID(如果已登录)
ReqBody string `json:"req_body"` // 请求体
RespBody string `json:"resp_body"` // 响应体
Status int `json:"status"` // HTTP 状态码
Duration int64 `json:"duration"` // 处理时间(毫秒)
Error string `json:"error"` // 错误信息
}
AccessLog 访问日志结构
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder 访问日志中间件构建器
func (*Builder) WithMaxBodyLength ¶
WithMaxBodyLength 设置最大记录长度
func (*Builder) WithReqBody ¶
WithReqBody 设置是否记录请求体
func (*Builder) WithRespBody ¶
WithRespBody 设置是否记录响应体
Click to show internal directories.
Click to hide internal directories.