middleware

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIException

func APIException(c *gin.Context, code int, msg string, data interface{})

APIException 通用异常处理

func APIFailure

func APIFailure(c *gin.Context, msg string, data interface{})

APIFailure 返回失败, 状态码: 200

func APISuccess

func APISuccess(c *gin.Context, data interface{}, count int)

APISuccess 返回成功, 状态码: 200

func CheckWhiteList

func CheckWhiteList(asAPI bool) gin.HandlerFunc

CheckWhiteList 接口白名单检查

func HTTPCounter added in v1.3.3

func HTTPCounter() gin.HandlerFunc

HTTPCounter 请求简单计数

func RecoveryWithLog

func RecoveryWithLog(stack bool) gin.HandlerFunc

RecoveryWithLog GinRecovery 及日志 Ref: https://github.com/gin-contrib/zap

func TxtMsg

func TxtMsg(c *gin.Context, msg string)

TxtMsg 返回文本消息

func WebAPILogger

func WebAPILogger() gin.HandlerFunc

WebAPILogger Web 日志写入 ES

Types

This section is empty.

Jump to

Keyboard shortcuts

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