package
0.0.10
Repository: https://github.com/binbinly/pkg.git
Documentation: pkg.go.dev

# Packages

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

# Functions

B2S BytesToString.
B64Decode Base64 解码.
B64Encode Base64 编码.
B64UrlDecode Base64 解码.
B64UrlEncode Base64 解码, 安全 URL, 替换: "+/" 为 "-_".
BeginOfDay 当天 0 点.
BeginOfHour 0 分.
BeginOfLastMonth 上月第一天 0 点.
BeginOfLastWeek 上周一 0 点.
BeginOfMinute 0 秒.
BeginOfMonth 当月第一天 0 点.
BeginOfNextMonth 下月第一天 0 点.
BeginOfNextWeek 下周一 0 点.
BeginOfSecond 0 毫秒.
BeginOfTomorrow 明天 0 点.
BeginOfWeek 本周一 0 点.
BeginOfYear 本年第一天 0 点.
BeginOfYesterday 昨天 0 点.
CallPath 运行时路径, 编译目录 假如: mklink E:\tmp\linkapp.exe D:\Fufu\Test\abc\app.exe 执行: E:\tmp\linkapp.exe CallPath: E:\Go\src\github.com\fufuok\utils\tmp\osext.
CPUTicks CPU 时钟周期, 更高精度 (云服务器做伪随机数种子时慎用) go:linkname CPUTicks runtime.cputicks.
CSTLayoutString 格式化时间 返回 "2006-01-02 15:04:05" 格式的时间.
CSTLayoutStringToUnix 返回 unix 时间戳 2020-01-24 21:11:11 => 1579871471.
DaysInYear 返回年份天数.
EndOfDay 当天最后时刻.
EndOfHour 最后一分.
EndOfLastMonth 上月最后一刻.
EndOfLastWeek 上周一最后一刻.
EndOfMinute 最后一秒.
EndOfMonth 当月最后一刻.
EndOfNextMonth 下月最后一刻.
EndOfNextWeek 下周一最后一刻.
EndOfSecond 最后一毫秒.
EndOfTomorrow 明天 0 点.
EndOfWeek 本周末最后一刻.
EndOfYear 本年最后一刻.
EndOfYesterday 昨天最后时刻.
Executable 当前执行程序绝对路径 true 时返回解析符号链接后的绝对路径 Excutable: E:\tmp\linkapp.exe Excutable(true): D:\Fufu\Test\abc\app.exe.
ExecutableDir 当前执行程序所在目录 true 时返回解析符号链接后的目录 ExcutableDir: E:\tmp ExcutableDir(true): D:\Fufu\Test\abc.
Extract returns a private addr and port.
ExtractHostPort from address.
FastIntn this is similar to rand.Intn, but faster.
FastRand 随机数 go:linkname FastRand runtime.fastrand.
FastRandBytes random bytes, but faster.
FastRandn 等同于 FastRand() % n, 但更快 See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/ go:linkname FastRandn runtime.fastrandn.
FormatAmount 格式化金额为分,入库保存.
FormatResUrl 格式化图片资源完整路劲.
GetMonthDays 当月天数.
GetRealIP get user real ip.
GMTLayoutString 格式化时间 返回 "Mon, 02 Jan 2006 15:04:05 GMT" 格式的时间.
Hostname 获取主机名.
InSliceInt 是否在 slice.
InSliceStr 是否在 slice.
InterfaceAddrs 获取所有带 IP 的接口和对应的所有 IP 排除本地链路地址和环回地址.
InternalIP 获取内网地址 (出口本地地址).
InternalIPv4 获取内网地址 (IPv4).
InternalIPv6 获取内网地址 (临时 IPv6 地址).
IsLeapYear 判断是否为闰年.
JoinBytes 拼接 []byte.
LeftPad 从左填充字符串到指定长度.
LeftPadBytes 从左填充到指定长度.
LocalIP 获取本地地址 (第一个).
LocalIPv4s 获取所有本地地址 IPv4.
MapBuildQuery map => url query.
MustInt 强制转为整数 (int).
MustString 强制转为字符串.
NanoTime 返回当前时间 (以纳秒为单位) go:linkname NanoTime runtime.nanotime.
NewRand goroutine-safe rand.Rand, optional seed value.
Pad 填充字符串到指定长度, 同 Python3: 'str'.center().
PadBytes 填充到指定长度.
ParseAmount 金额分转元,保留两位小数输出.
ParseCSTInLocation 格式化时间.
ParseGMTInLocation 格式化时间.
Port return a real port.
RandBytes returns n random bytes.
RandHex a random string containing only the following characters: 0123456789abcdef.
RandInt (>=)min - (<)max.
RandString a random string, which may contain uppercase letters, lowercase letters and numbers.
RandUint32 (>=)min - (<)max.
Recover 从 panic 中恢复并记录堆栈信息.
RightPad 从右填充字符串到指定长度.
RightPadBytes 从右填充到指定长度.
RunPath 实际程序所在目录 RunPath: E:\tmp.
S2B StringToBytes converts string to byte slice without a memory allocation.
SafeGo 带 Recover 的 goroutine 运行.
SliceBigFilter 过滤切片元素 适合大切片.
SliceDeleteElem 索引删除 slice 元素.
SliceIntDeduplication 去除重复的元素.
SliceIntJoin 整型数组拼接成字符串.
SliceReverse slice 反转.
SliceShuffle shuffle a slice.
SliceSmallFilter 过滤切片元素 适合小切片.
SliceToInt 字符串数组转换成整型数组.
SubInLocation 计算时间差.
WaitSignal 等待系统信号 默认捕获退出类信息.

# Variables

Rand goroutine-safe, use Rand.xxx instead of rand.xxx.
No description provided by the author
No description provided by the author

# Type aliases

RecoveryCallback 自定义恢复信息回调.