middleware

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorLogger

func ErrorLogger() gin.HandlerFunc

ErrorLogger returns a handlerfunc for any error type.

func ErrorLoggerT

func ErrorLoggerT(typ gin.ErrorType) gin.HandlerFunc

ErrorLoggerT returns a handlerfunc for a given error type.

func Logger

func Logger() gin.HandlerFunc

Logger instances a Logger middleware that will write the logs to gin.DefaultWriter. By default gin.DefaultWriter = os.Stdout.

func LoggerWithConfig

func LoggerWithConfig(conf log2.LoggerConfig) gin.HandlerFunc

LoggerWithConfig instance a Logger middleware with config.

func LoggerWithFormatter

func LoggerWithFormatter(f log2.LogFormatter, logger *log.Logger, hasErr bool) gin.HandlerFunc

LoggerWithFormatter instance a Logger middleware with the specified log format function.

func SetLog

func SetLog(app *gin.Engine, logger2 *log.Logger, errHandle bool)

Types

type ModName

type ModName string

func (ModName) ApiDocMiddle

func (m ModName) ApiDocMiddle(ctx *gin.Context)

Jump to

Keyboard shortcuts

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