Documentation
¶
Index ¶
- func Abs(x int) int
- func Add(x, y interface{}, decimal float64, z ...interface{}) float64
- func Age(item AgeItem) (age uint, fmAge string)
- func AlphaDash(s string) bool
- func AlphaNum(s string) bool
- func ChsAlphaNum(s string) bool
- func ChsDash(s string) bool
- func CountRunes(s string) int
- func CreateToken(prefix string, other ...string) string
- func Decode(buffer []byte, v interface{}) error
- func DecodeTo(buffer []byte) interface{}
- func DeviceFrom(s string) string
- func Div(x, y interface{}, decimal float64) float64
- func Float64(any interface{}) float64
- func GenCombinations(values []string) [][]string
- func GenCombinationsString(values []string, sep string) []string
- func GenPasswordHash(password ...string) (string, string, error)
- func GetIp(ctx context.Context) string
- func GetMetaString(r *ghttp.Request, tag string) string
- func GetMetaVar(r *ghttp.Request, tag string) *g.Var
- func HashMd5(slices ...string) (string, error)
- func HashMd5String(slices ...string) string
- func IsBase64(s string) bool
- func IsEmail(email string) bool
- func IsExpired(expired string, d ...int64) error
- func IsHex(hex string) bool
- func IsMobile(s string) bool
- func IsPC(s string) bool
- func IsSeparator(r rune) bool
- func IsSha256Hash(hash string) bool
- func MacString(sep ...string) (string, error)
- func MobileDeviceAll() []string
- func Mul(x, y interface{}, decimal float64, z ...interface{}) float64
- func MustMacString(sep ...string) string
- func NewAccount(ps ...string) string
- func NewArray(data interface{}) *sArray
- func OrmWhereLeftLike(s string) string
- func OrmWhereLike(s string) string
- func OrmWhereRightLike(s string) string
- func ParseHandlerFunc(r *ghttp.Request) *reflect.Value
- func ParseUserAgentDevice(s string) string
- func PasswordHash(pwd string, salts ...string) (string, error)
- func PasswordVerify(pwdHash string, pwd string, salts ...string) bool
- func RandInt(n int) int
- func RandomInt(minVal, maxVal int) int
- func Scale(s, decimal float64) float64
- func ScanIsEmpty(errorMsg string) bool
- func SeparatorStringToArray(s string) []string
- func ShareFeeOrRate(item ShareFeeItem, addShareFee, addRate *float64) (shareFee, rate float64)
- func SliceAddPrefix(slice []string, prefix string) []string
- func Slugify(path string, seps ...string) string
- func SmsReplaceVal(s string, rplVal ...string) string
- func SplitNonCharWords(s string) []string
- func SplitSymbolWords(s string) []string
- func StrPad(s string, length int, padStr byte, padType ...byte) string
- func Sub(x, y interface{}, decimal float64, z ...interface{}) float64
- func Summary(r *ghttp.Request) string
- func Timestamp(date string) (int64, error)
- func ToDayZeroDiff() time.Duration
- func ToSha256(b []byte) string
- type AgeItem
- type IMac
- type ShareFeeItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶ added in v1.0.4
CreateToken 随机创建Token
func GenCombinations ¶
GenCombinations 生成数据集合 Example values := []string{`淘宝`,`美妆`,`双十一`} fmt.Println(GenCombinations(values, `-`)) Result: 淘宝 淘宝-美妆 淘宝-双十一 淘宝-美妆-双十一
func GenCombinationsString ¶
GenCombinationsString 生成数据集合 Example values := []string{`淘宝`,`美妆`,`双十一`} fmt.Println(GenCombinationsString(values, `-`)) Result: 淘宝 淘宝-美妆 淘宝-双十一 淘宝-美妆-双十一
func GenPasswordHash ¶
GenPasswordHash 生成Hash密码
func GetMetaString ¶ added in v1.0.7
GetMetaString 获取Meta元数据类型属性值
func GetMetaVar ¶ added in v1.0.7
GetMetaVar 获取MetaTag值
func OrmWhereLeftLike ¶ added in v1.0.3
OrmWhereLeftLike 左匹配模糊查询
func OrmWhereRightLike ¶ added in v1.0.3
OrmWhereRightLike 右模糊查询
func ParseHandlerFunc ¶
ParseHandlerFunc 解析g.Meta元数据函数
func ParseUserAgentDevice ¶
ParseUserAgentDevice 解析UserAgent设备消息
func PasswordHash ¶
PasswordHash Hash加密
func PasswordVerify ¶
PasswordVerify 验证HASH密码有效性
func SeparatorStringToArray ¶
SeparatorStringToArray 风格拆分字符串为数组字符串
func ShareFeeOrRate ¶
func ShareFeeOrRate(item ShareFeeItem, addShareFee, addRate *float64) (shareFee, rate float64)
ShareFeeOrRate 计算分摊金额和比例
func SliceAddPrefix ¶
SliceAddPrefix 字符串数组元素值添加前缀
func SplitNonCharWords ¶
SplitNonCharWords 使用非字符(\W)作为分隔符来分割字符串,并去除结果中的空字符串
Types ¶
type AgeItem ¶
type AgeItem struct { Birthday string // 生日 Type int // 类型:0默认年岁,1年月,2年月日, 3年月日时,4年月日时分 IsFmt bool // 是否格式年月日:false默认格式化,true不格式化返回(岁数,不返月份和天数) }
AgeItem 计算年龄