package
1.0.142
Repository: https://github.com/youchuangcd/gopkg.git
Documentation: pkg.go.dev

# Functions

AesDecryptCBC AES-CBC 解密.
No description provided by the author
AesDecryptECBHex @Description: @param data @param key @return s.
AesEncryptCBC AES-CBC 加密 key 必须是 16(AES-128)、24(AES-192) 或 32(AES-256) 字节的 AES 密钥; 初始化向量 iv 为随机的 16 位字符串 (必须是16位), 解密需要用到这个相同的 iv,因此将它包含在密文的开头。.
No description provided by the author
AesEncryptECBHex @Description: @param data @param key @return s.
AgeStr2Uint @Description: 年龄字符串转整形 @param s @return res.
AmountToFloat 金额字符串转浮点.
BindValid @Description: 绑定参数并翻译验证错误 @param c @param form @return error.
ComparePassword @Description: 比较密码 @param requestPassword @param dbPassword @param salt @return bool.
No description provided by the author
CutStr @Description: 截取字符串 @param s @param limit 不支持负数 @param rs 中间替换的内容,如..
CutStrFromLogConfig @Description: 根据日志配置截取字符长度 @param s @return string.
Decimal @Description: 浮点数保留几位小数 @param v @param args @return float64.
DiffArray 求两个切片的差集.
No description provided by the author
MIN 为用户自定义的比较精度.
FormatMobileStar @Description: 手机号中间4位替换为*号 @param mobile @return string.
No description provided by the author
GenPassword @Description: 生成密码 @param password @param salt @return string.
GenToken @Description: 生成token @param userId @return string.
GenTraceId @Description: 生成TraceId @param ctx @return string.
No description provided by the author
GetDiffDays @Description: 获取两个时间相差的天数,0表同一天,正数表t1>t2,负数表t1<t2 @param t1 @param t2 @return int.
GetMac retrieves and returns the first mac address of current host.
GetMacArray retrieves and returns all the mac address of current host.
No description provided by the author
GetPeriodValueByTime @Description: 指定多少天为一个周期,计算今天在周期中的位置 @param now @param periodDayNum @return int64.
GetSysUserIdByContext @Description: 从上下文中获取系统用户id @param ctx @return uint @return bool.
GetTraceIdByContext @Description: 从上下文中获取traceId @param ctx @return string @return bool.
GetUserIdByContext @Description: 从上下文中获取用户id @param ctx @return uint @return bool.
IntStr2Uint @Description: 整形字符串转Uint @param s @return res.
IsNil @Description: 判断interface的值是否为nil, 只判断指针、切片、map、chan、func @param i @return bool.
IsNowInTimeRange @Description: 当前时间是否在指定范围内 @param startTimeStr 参数为时间字符串,格式为"时:分:秒" @param endTimeStr 参数为时间字符串,格式为"时:分:秒" @return bool.
判断字符串是不是纯数字.
判断元素是否在切片中存在.
JoinEnvStr @Description: 拼接环境变量,默认以下划线加环境变量拼接在后面; eg: str_dev @param s @param extArgs 指定拼接符 JoinEnvStr("xxx", "环境变量"); JoinEnvStr("xxx", "环境变量", "拼接符") @return string.
MapUrlEncode @Description: map转url encode @param data map[string]any @return string.
No description provided by the author
No description provided by the author
MerchantResJson @Description: 响应给商户的结构 @param ctx @param e @param data @param args.
No description provided by the author
NewPool @Description: 创建goroutine池,用完要记得defer goPool.Release() @param poolSize @param options @return goPool @return err.
NewPoolWithFunc @Description: 创建固定方法goroutine池,用完要记得defer goPool.Release() @param poolSize @param pf @param options @return goPool @return err.
明文补码算法.
明文减码算法.
RandInt @Description: 获取指定范围内的随机数 @param min 可为负数 @param max 不可为负数; 包含max @return r int.
获取随机数字.
获取随机字符串.
RandShuffle @Description: 打乱切片 @param slice.
生成随机字符串.
字符串切片去重.
RemoveRepeatElementSlice @Description: 移除切片重复的元素 @param s @return interface{} 返回值需要对应类型的转换.
RemoveRepeatElementSliceString @Description: 字符串切片去重 @param arg @return []string @return error.
RemoveRepeatElementSliceUint @Description: uint切片去重 @param arg @return []uint @return error.
No description provided by the author
*时间转换函数秒数转换为 分钟:秒 */.
No description provided by the author
No description provided by the author
SliceRemoveZeroValue @Description: 切片移除零值 @param src 必须传切片的指针.
SliceTrimSpace @Description: 字符串切片去除首尾空格 @param s @return []string.
No description provided by the author
No description provided by the author
No description provided by the author
TrimEnvStr @Description: 修剪字符串后缀,移除环境变量字符串; str_dev => str @param s @param extArgs @return string.
No description provided by the author
No description provided by the author
字符串在指定的列数处换行文本 s string 字符串文本数据 limit int 限制单词个数.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
定义每天的秒数.
定义每小时的秒数.
定义每分钟的秒数.

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author