Documentation ¶
Index ¶
- Constants
- func Cors() gin.HandlerFunc
- func H(h HandlerFunc) gin.HandlerFunc
- func Logger() gin.HandlerFunc
- func LoggerWithConfig(conf gin.LoggerConfig) gin.HandlerFunc
- type Context
- func (c *Context) GetUID(auth *ginjwt.GinJWTMiddleware) int
- func (c *Context) HandlerError(err error) bool
- func (c *Context) HandlerOk(data interface{})
- func (c *Context) IsMobile() bool
- func (c *Context) PostFormInt(key string) int
- func (c *Context) QueryInt(key string) int
- func (c *Context) RespError(err string)
- func (c *Context) UnmarshalFromString(o interface{}) (err error)
- func (c *Context) VersionCheck(version, version1 int) bool
- type HandlerFunc
- type R
Constants ¶
View Source
const ( STATUSERROR = iota STATUSOK )
View Source
const ErrorTypePrivate gin.ErrorType = 1 << 0
Variables ¶
This section is empty.
Functions ¶
func LoggerWithConfig ¶
func LoggerWithConfig(conf gin.LoggerConfig) gin.HandlerFunc
LoggerWithConfig instance a Logger middleware with config.
Types ¶
type Context ¶
Context ext content struct
func (*Context) GetUID ¶
func (c *Context) GetUID(auth *ginjwt.GinJWTMiddleware) int
GetUID 根据session获取用户的id
func (*Context) HandlerError ¶
func (*Context) PostFormInt ¶
PostFormInt 获取form 里面的参数并转成int类型
func (*Context) UnmarshalFromString ¶
UnmarshalFromString 把字符串解析到对象里面 o需要传入指针类型
func (*Context) VersionCheck ¶
VersionCheck 数据版本检查
Click to show internal directories.
Click to hide internal directories.