httplogger

package
v0.0.0-...-56195c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 6 Imported by: 0

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
	Header   map[string][]string
	Url      string
	Duration string
	ReqBody  string
	RespBody string
	Status   int
}

日志内容

type MiddlewareBuilder

type MiddlewareBuilder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(fn func(ctx context.Context, al *AccessLog)) *MiddlewareBuilder

func (*MiddlewareBuilder) AllowReqBody

func (b *MiddlewareBuilder) AllowReqBody(ok bool) *MiddlewareBuilder

AllowReqBody 是否允许记录请求体

func (*MiddlewareBuilder) AllowRespBody

func (b *MiddlewareBuilder) AllowRespBody(ok bool) *MiddlewareBuilder

AllowRespBody 是否允许记录响应体

func (*MiddlewareBuilder) Build

func (b *MiddlewareBuilder) Build() gin.HandlerFunc

Build 构建中间件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL