middleware

package
v1.6.40 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortWithJson added in v1.6.0

func AbortWithJson(ctx *gin.Context, a ...interface{})

func GetRestHandler added in v1.6.0

func GetRestHandler(ctx *gin.Context) *types.RestHandler

func GetSessionData

func GetSessionData(ctx *gin.Context, check types.ICheck) map[string]interface{}

func LoggerWithZap

func LoggerWithZap(logMaxTime, sendMaxTime time.Duration) 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 LoginCheck added in v1.6.0

func LoginCheck() gin.HandlerFunc

func ParseSession added in v1.6.0

func ParseSession(check types.ICheck) gin.HandlerFunc

func QueryPostForm added in v1.6.0

func QueryPostForm(ctx *gin.Context, keys ...string) string

func RecoveryWithZap

func RecoveryWithZap() 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().

func SetRestHandler added in v1.6.0

func SetRestHandler(ctx *gin.Context, handler *types.RestHandler)

func SignCheck added in v1.6.0

func SignCheck(check types.ICheck) gin.HandlerFunc

func VersionCompare added in v1.6.0

func VersionCompare(check types.ICheck, handlers types.RestHandlers) gin.HandlerFunc

func WithOpenTracing added in v1.6.8

func WithOpenTracing() option.App

func WithRestCheck added in v1.5.0

func WithRestCheck(routes types.Restful) option.App

func WithZapLogger added in v1.5.0

func WithZapLogger() option.App

func WithZapRecovery added in v1.5.0

func WithZapRecovery() option.App

Types

This section is empty.

Jump to

Keyboard shortcuts

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