accesslog

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 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 `json:"method"`
	Path       string `json:"path"`
	ReqBody    string `json:"req_body"`
	Duration   string `json:"duration"`
	StatusCode int    `json:"status_code"`
	RespBody   string `json:"resp_body"`
}

AccessLog 自定义打印信息

type MiddlewareBuilder

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

func NewMiddlewareBuilder

func NewMiddlewareBuilder(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

Jump to

Keyboard shortcuts

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