middleware

package
v0.0.0-...-c6e1f3d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(ege *gin.Engine, api *abs.Rest) gin.HandlerFunc

func LoggerWithZap

func LoggerWithZap(zl *zap.Logger) gin.HandlerFunc

LoggerWithZap returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap. Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().

func RecoveryWithZap

func RecoveryWithZap(zl *zap.Logger, stack bool) gin.HandlerFunc

RecoveryWithZap returns a gin.HandlerFunc (middleware) that recovers from any panics and logs requests using uber-go/zap. All errors are logged using zap.Error(). stack means whether output the stack info. The stack info is easy to find where the error occurs but the stack info is too large.

Types

This section is empty.

Jump to

Keyboard shortcuts

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