Documentation ¶
Index ¶
Constants ¶
View Source
const SessionIDKey = "user_session"
Variables ¶
This section is empty.
Functions ¶
func AuthRequired ¶
func AuthRequired(s *Session) gin.HandlerFunc
func Recovery ¶
func Recovery(logger *zap.Logger) gin.HandlerFunc
Recovery 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 ¶
Click to show internal directories.
Click to hide internal directories.