Documentation ¶
Index ¶
- func ClearAllSession(ctx *gin.Context)
- func ContextBindQueryWithValid(ctx *gin.Context, obj interface{}) (err error)
- func ContextBindWithValid(ctx *gin.Context, obj interface{}) (err error)
- func CorsMiddleware() gin.HandlerFunc
- func GetSession(ctx *gin.Context, k string) interface{}
- func HandleNotFound(c *gin.Context)
- func LoggerWriter() gin.HandlerFunc
- func New(middleware ...gin.HandlerFunc) *gin.Engine
- func NewMemStore() sessions.Store
- func NewRedisStore(uri string, db int, password string) (sessions.Store, error)
- func RecoveryWriter() gin.HandlerFunc
- func SetSession(ctx *gin.Context, k string, o interface{})
- func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool
- func TelephoneValid(phone string) bool
- func UseSession(router *gin.Engine, store sessions.Store)
- type SkipperFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearAllSession ¶
func ContextBindWithValid ¶
func CorsMiddleware ¶
func CorsMiddleware() gin.HandlerFunc
func GetSession ¶
func HandleNotFound ¶
func LoggerWriter ¶
func LoggerWriter() gin.HandlerFunc
LoggerWithWriter instance a Logger middleware with the specified writter buffer. Example: os.Stdout, a file opened in write mode, a socket...
func NewMemStore ¶
func NewRedisStore ¶
func RecoveryWriter ¶
func RecoveryWriter() gin.HandlerFunc
RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
func SetSession ¶
func SkipHandler ¶
func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool
SkipHandler 统一处理跳过函数
func TelephoneValid ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.