Documentation ¶
Index ¶
- func Default(l *zap.Logger) gin.HandlerFunc
- type AccessLog
- type MiddleWareBuilder
- func (b *MiddleWareBuilder) AllowRequestBody(flag bool) *MiddleWareBuilder
- func (b *MiddleWareBuilder) AllowResponseBody(flag bool) *MiddleWareBuilder
- func (b *MiddleWareBuilder) BodyLength(length int) *MiddleWareBuilder
- func (b *MiddleWareBuilder) Build() gin.HandlerFunc
- func (b *MiddleWareBuilder) UrlLength(length int) *MiddleWareBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessLog ¶
type AccessLog struct { Duration string Method string Url string Status int RequestBody string ResponseBody string }
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) BodyLength ¶
func (b *MiddleWareBuilder) BodyLength(length int) *MiddleWareBuilder
BodyLength 设置请求体最大长度
func (*MiddleWareBuilder) UrlLength ¶
func (b *MiddleWareBuilder) UrlLength(length int) *MiddleWareBuilder
UrlLength 设置url最大长度
Click to show internal directories.
Click to hide internal directories.