Documentation ¶
Overview ¶
Package utils
string.go includes utils functions related string
Index ¶
- Constants
- Variables
- func CopyRequest(req *http.Request) *http.Request
- func Fstring(format string, v ...interface{}) string
- func GenPasswordHash(pwd, salt string) string
- func ParseRequest(req *http.Request)
- func RandStr(length int) string
- func Response(i interface{}, ci *CodeInfo)
- func StringEncMd5(s string) string
- func UniqueId() string
- type CodeInfo
Constants ¶
View Source
const ( CodeOk = iota CodeParamRequired CodeParamInvalid CodeWrongDataType CodeUndefinedField CodeNoRegMobile CodeDupMobile CodeWrongPwd CodeSystemErr = 500 + iota CodeResponseTimeout = 503 CodeNotFound = 404 CodeMethodNotAllowed = 405 )
Variables ¶
View Source
var Messages = map[int]string{ CodeOk: "成功", CodeParamRequired: "缺少参数", CodeParamInvalid: "非法参数", CodeWrongDataType: "错误的数据类型", CodeUndefinedField: "未定义的字段", CodeNoRegMobile: "手机号码尚未注册", CodeDupMobile: "手机号码已经注册", CodeWrongPwd: "密码错误", CodeSystemErr: "系统错误", CodeResponseTimeout: "响应超时", CodeNotFound: "Api未找到", CodeMethodNotAllowed: "该方法不允许", }
View Source
var TimeoutJsonResp string
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.