Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiddlewareBuilder ¶
type MiddlewareBuilder struct {
// contains filtered or unexported fields
}
MiddlewareBuilder 注意点: 1. 小心日志内容过多。URL 可能很长,请求体,响应体都可能很大,你要考虑是不是完全输出到日志里面 2. 考虑 1 的问题,以及用户可能换用不同的日志框架,所以要有足够的灵活性 3. 考虑动态开关,结合监听配置文件,要小心并发安全
func NewBuilder ¶
func NewBuilder(fn func(ctx context.Context, al *AccessLog)) *MiddlewareBuilder
func (*MiddlewareBuilder) AllowReqBody ¶
func (b *MiddlewareBuilder) AllowReqBody(ok bool) *MiddlewareBuilder
func (*MiddlewareBuilder) AllowRespBody ¶
func (b *MiddlewareBuilder) AllowRespBody() *MiddlewareBuilder
func (*MiddlewareBuilder) Build ¶
func (b *MiddlewareBuilder) Build() gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.