Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct { //http 请求类型 Method string //url 整个请求的url Url string //请求体 RequestBody string //响应体 ResponseBody string //处理时间 Duration string //状态码 Status int }
AccessLog 请求日志
type MiddleWareBuilder ¶
type MiddleWareBuilder struct {
// contains filtered or unexported fields
}
MiddleWareBuilder 日志打印中间件
func NewBuilder ¶
func NewBuilder(loggerFunc func(ctx context.Context, log *AccessLog)) *MiddleWareBuilder
NewBuilder 创建日志打印中间件构造器
func (*MiddleWareBuilder) AllowRequestBody ¶
func (b *MiddleWareBuilder) AllowRequestBody(flag bool) *MiddleWareBuilder
AllowRequestBody 是否打印请求体
func (*MiddleWareBuilder) AllowResponseBody ¶
func (b *MiddleWareBuilder) AllowResponseBody(flag bool) *MiddleWareBuilder
AllowResponseBody 是否打印响应体
func (*MiddleWareBuilder) MaxLength ¶
func (b *MiddleWareBuilder) MaxLength(length int) *MiddleWareBuilder
MaxLength 打印的最大长度
Click to show internal directories.
Click to hide internal directories.