ginzap

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config ...Config) gin.HandlerFunc

Types

type Config

type Config struct {
	// 当函数返回true时,跳过中间件
	Next func(c *gin.Context) bool
	// 不走中间件的path
	SkipPaths []string
	// 日志记录器
	Logger *zap.Logger
	// 日志记录的字段,默认为{"status","method","path","ip","latency"}
	Fields []string
	// 请求状态信息,默认为{"Server error", "Client error", "Success    "}
	Messages []string
}

Jump to

Keyboard shortcuts

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