Documentation
¶
Index ¶
- Variables
- func GinRecover(c *gin.Context)
- func RandStringBytes(n int) string
- func RegValidator()
- func ReqFromHTML(c *gin.Context) bool
- func ShouldBindBodyWith(c *gin.Context, obj interface{}, bb binding.BindingBody) (err error)
- func StatusText(code ErrCode) string
- type ErrCode
- type JSONTime
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildBy = time.Now()
BuildBy BuildBy
View Source
var ErrorCodeText = map[ErrCode]string{ Success: "获取成功", Errors: "遇到错误", LoginSuccess: "登陆成功", AuthedError: "登陆超时", NotFound: "没有数据", }
ErrorCodeText 错误提示
Functions ¶
func ShouldBindBodyWith ¶
func ShouldBindBodyWith(c *gin.Context, obj interface{}, bb binding.BindingBody) (err error)
ShouldBindBodyWith is similar with ShouldBindWith, but it stores the request body into the context, and reuse when it is called again.
NOTE: This method reads the body before binding. So you should use ShouldBindWith for better performance if you need to call only once.
Types ¶
type JSONTime ¶
JSONTime JSONTime
func (JSONTime) MarshalJSON ¶
MarshalJSON json格式化时间的方法
func (*JSONTime) UnmarshalJSON ¶
UnmarshalJSON UnmarshalJSON
Source Files
¶
Click to show internal directories.
Click to hide internal directories.