Documentation ¶
Index ¶
- func AddSepIfNeeded(pth string) string
- func Base64Decode(str string) string
- func CWD() string
- func DeepCopy(dst, src interface{}) error
- func EXEName() string
- func ErrorLogFilename() string
- func GetExeDir() string
- func GetRandomString(n int) string
- func HashPassword(pwd string) string
- func InArrayS(items []string, s string) bool
- func IsPortInUse(port int) bool
- func LocalIP() string
- func LogDir() string
- func MD5(str string) string
- func ParseFlostToString(f float64) string
- func ParseInt(b string, defInt int) int
- func ParseString(b int) string
- func PrintUsage()
- func ReadResData(path string) string
- func StructToMap(obj interface{}) map[string]interface{}
- func StructToString(data interface{}) string
- func SubString(str string, start, length int) string
- func TimeFormat(time *time.Time) string
- func UnitJoin(ss []uint, sep string) string
- func WorkInDir(f func(), dir string)
- func WwwPath() string
- type GeneratePhoneNumber
- type Request
- type Response
- type ResponsePage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSepIfNeeded ¶
func Base64Decode ¶
*
- base64 解码
- @method func
- @param {[type]} t *Tools [description]
- @return {[type]} [description]
func ErrorLogFilename ¶
func ErrorLogFilename() string
func HashPassword ¶
func IsPortInUse ¶
func ParseFlostToString ¶
*
- 转换浮点数为string
- @method func
- @param {[type]} t * Tools [description]
- @return {[type]} [description]
func ParseInt ¶
*
- string转换int
- @method parseInt
- @param {[type]} b string [description]
- @return {[type]} [description]
func ParseString ¶
*
- int转换string
- @method parseInt
- @param {[type]} b string [description]
- @return {[type]} [description]
func PrintUsage ¶
func PrintUsage()
func ReadResData ¶
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
*
- 结构体转换成map对象
- @method func
- @param {[type]} t *Tools [description]
- @return {[type]} [description]
func StructToString ¶
func StructToString(data interface{}) string
*
- 结构体转成json 字符串
- @method StruckToString
- @param {[type]} data interface{} [description]
func SubString ¶
*
- 字符串截取
- @method func
- @param {[type]} t *Tools [description]
- @return {[type]} [description]
func TimeFormat ¶
*
- 时间格式化
- @method func
- @param {[type]} t *Tools [description]
- @return {[type]} [description]
Types ¶
type GeneratePhoneNumber ¶
type GeneratePhoneNumber struct {
CacheData []string
}
func (*GeneratePhoneNumber) CreatePhoneNumber ¶
func (*GeneratePhoneNumber) CreatePhoneNumber() string
生成随机手机号码
func (*GeneratePhoneNumber) CreateUniquePhoneNumber ¶
func (g *GeneratePhoneNumber) CreateUniquePhoneNumber() string
生成唯一随机手机号码
type Response ¶
type Response struct { Code int64 `json:"code"` Msg interface{} `json:"message"` Data interface{} `json:"data"` }
type ResponsePage ¶
type ResponsePage struct { Response PageSize int `json:"pageSize"` PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` TotalPage int64 `json:"totalPage"` }
func ApiResPage ¶
func ApiResPage(code int64, msg string, objects interface{}, pageNo, pageSize int, total int64) (r *ResponsePage)
Click to show internal directories.
Click to hide internal directories.