Documentation ¶
Index ¶
Constants ¶
View Source
const ( RespMiddleWareDisabled = "RespMiddleWareDisabled" ReqError = "error" ReqResult = "result" )
View Source
const ( Address = "address" Signature = "signature" DeviceName = "deviceName" DeviceType = "deviceType" Uuid = "uuid" Version = "version" )
View Source
const HeaderTimeOut = 120 * time.Second
Variables ¶
View Source
var Chat33GinLogFormatter = func(param gin.LogFormatterParams) string { var statusColor, methodColor, resetColor string if param.IsOutputColor() { statusColor = param.StatusCodeColor() methodColor = param.MethodColor() resetColor = param.ResetColor() } if param.Latency > time.Minute { param.Latency = param.Latency - param.Latency%time.Second } return fmt.Sprintf("[GIN] %v |%s %3d %s| %13v | %15s |%s %-7s %s %s\n%s", param.TimeStamp.Format("2006/01/02 - 15:04:05"), statusColor, param.StatusCode, resetColor, param.Latency, param.ClientIP, methodColor, param.Method, resetColor, param.Path, param.ErrorMessage, ) }
defaultLogFormatter is the default log format function Logger middleware uses.
Functions ¶
func AuthMiddleWare ¶
func AuthMiddleWare() gin.HandlerFunc
func CheckNumber ¶
func HeaderMiddleWare ¶
func HeaderMiddleWare() gin.HandlerFunc
func NewAddrWithContext ¶
func RespMiddleWare ¶
func RespMiddleWare() gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.