Documentation ¶
Index ¶
- Constants
- Variables
- type Tool
- func (t *Tool) AmountToCN(pMoney float64, pRound bool) string
- func (t *Tool) BcryptHashCompare(current string, req string) bool
- func (t *Tool) BcryptHashGenerate(s string) string
- func (t *Tool) CheckNickName(nikename string) (err error)
- func (t *Tool) CheckPasswordLevel(ps string) error
- func (t *Tool) CheckUserName(uname string) (err error)
- func (t *Tool) EncodeMD5(value string) string
- func (t *Tool) FloatToStr(f float64) string
- func (t *Tool) GBK2UTF8(s []byte) ([]byte, error)
- func (t *Tool) GetRandomInt(n int) string
- func (t *Tool) GetRandomString(n int) string
- func (t *Tool) HideStar(str string) (result string)
- func (t *Tool) IntToStr(i int) string
- func (t *Tool) MustUUID() string
- func (t *Tool) PtrIsNil(ptr interface{}) bool
- func (t *Tool) RemoteIp(req *http.Request) string
- func (t *Tool) RemoveRepeated(obj interface{}) (err error)
- func (t *Tool) StrToInt(str string, def int) (int, error)
- func (t *Tool) StrToInt64(str string, def int64) (int64, error)
- func (t *Tool) StrToUint(str string, def uint) (uint, error)
- func (t *Tool) StringFormatTime(timeLayout string) int64
- func (t *Tool) StructToMap(obj interface{}) (result map[string]interface{}, err error)
- func (t *Tool) StructToStr(data interface{}) (string, error)
- func (t *Tool) StructToStruct(source, input interface{}) (err error)
- func (t *Tool) SubString(str string, start, length int) string
- func (t *Tool) Substr2(str string, start int, end int) string
- func (t *Tool) TimeFormat(time time.Time, format string) string
- func (t *Tool) UTF82GB2312(s []byte) ([]byte, error)
- func (t *Tool) UTF82GBK(s []byte) ([]byte, error)
- func (t *Tool) VerifyEmailFormat(email string) bool
- func (t *Tool) VerifyMobileFormat(mobileNum string) bool
Constants ¶
View Source
const GoTime = "2006-01-02 15:04:05"
Variables ¶
View Source
var (
Tools = New()
)
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct { }
func (*Tool) BcryptHashCompare ¶
BcryptHashCompare 对比bctypt的哈希值
func (*Tool) BcryptHashGenerate ¶
BcryptHashGenerate 生成bctypt的哈希值
func (*Tool) CheckNickName ¶
func (*Tool) CheckPasswordLevel ¶
func (*Tool) CheckUserName ¶
func (*Tool) StringFormatTime ¶
func (*Tool) VerifyMobileFormat ¶
mobile verify
Click to show internal directories.
Click to hide internal directories.