# 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
Package empty 提供检查变量是否为空/nil的函数.
Package errors provides functionalities to manipulate errors for internal usage purpose.
Package grand 提供高性能的随机字节/数字/字符串生成功能。.
No description provided by the author
Package gstr 提供字符串处理的工具函数.
Package gstructs 提供结构体信息检索的功能.
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
Package ratelimit 提供了一个灵活的令牌桶实现,用于速率限制。.
Package reflection provides some reflection functions for internal usage.
Package rwmutex provides switch of concurrent safety feature for sync.RWMutex.
Package gtag providing tag content storing for struct.
No description provided by the author
No description provided by the author
# Functions
AddDays 在指定日期上添加天数.
AddHours 在指定时间上添加小时数.
AddMinutes 在指定时间上添加分钟数.
AddMonths 在指定日期上添加月份.
AddSeconds 在指定时间上添加秒数.
AddYears 在指定日期上添加年份.
No description provided by the author
CalcDaysFromYearMonth 返回给定年份和月份的天数.
CanCallIsNil Can reflect.Value call reflect.Value.IsNil.
CompareTime 比较两个时间大小.
No description provided by the author
ConvertToUTC 将指定时间转换为UTC时间.
CreateFilePath 创建路径.
Decimal 保留两位小数.
Decrypt 使用私钥解密数据.
DecryptOAEP 使用私钥解密数据.
DecryptPKCS1v15 使用私钥解密数据.
删除文件.
DirSize 获取目录下所有文件大小.
No description provided by the author
Encrypt 使用公钥加密数据.
EncryptOAEP 使用公钥加密数据.
No description provided by the author
EncryptPKCS1v15 使用公钥加密数据.
EncryptString encrypts `data` using MD5 algorithms.
EndTime 获得今天结束时间戳.
EndTimeByTime 获得时间戳对应的23点59分59秒时间戳.
EqualFoldWithoutChars 比较两个字符串是否相等(忽略大小写和特殊字符).
FileSize 字节的单位转换 保留两位小数.
FormatCmdKey 格式化命令键名.
FormatDuration 格式化时间间隔.
FormatEnvKey 格式化环境变量键名.
FormatSize 格式化文件大小。.
FormatTimeRange 格式化时间范围.
GenerateKeyPair 生成RSA密钥对.
GetAgeByBirthday 根据生日计算年龄.
GetBeforeDay 获得指定日期的前一天的日.
GetBeforeMonth 获得指定日期的前一天的月.
GetBeforeTime 获得指定日期的前一天日期.
GetBeforeWeek 获得指定日期前一天的星期几.
GetBeforeYear 获得指定日期的前一天的年.
GetBetweenDates 根据开始日期和结束日期计算出时间段内所有日期.
GetCurrentDateString 获取当前日期字符串.
GetCurrentQuarter 获取当前季度.
GetDay 获得当前时间的天数.
GetDayByTimeInt 获得指定时间戳的天数.
GetDayByTimeLong 获得指定时间戳的天数.
GetDayOfYear 获取指定日期是所在年份的第几天.
GetDaysInMonth 获取指定年月的天数.
GetDaysInYear 获取指定年份的天数.
GetFirstDateOfMonth 获取指定年月的第一天.
GetFirstDateOfWeek 获取指定日期所在周的周一.
GetFirstDayOfNextMonth 获取下个月的第一天.
GetHour 获得当前时间的小时数.
GetHourBetweenDates 获取两个日期之间的所有小时.
GetHourByTimeInt 获得指定时间戳的小时数.
GetHourByTimeLong 获得指定时间戳的小时数.
GetHourDiffer 计算两个时间差多少小时.
GetLastDateOfMonth 获取指定年月的最后一天.
GetLastDateOfWeek 获取指定日期所在周的周日.
GetLastDayOfPreviousMonth 获取上个月的最后一天.
GetLocalIP 获取服务器内网IP.
GetMicrosecondsFromTime 获取时间的微秒数.
GetMin 返回两个整数中的较小值.
GetMinute 获得当前时间的分钟数.
GetMinuteByTimeInt 获得指定时间戳的分钟数.
GetMinuteByTimeLong 获得指定时间戳的分钟数.
GetMinutesDiffer 计算两个时间差多少分钟.
GetMondayTime 获得当前时间戳下的周一的时间戳.
GetMonth 获得当前时间的月份.
GetMonthByTimeInt 获得指定时间戳的月份.
GetMonthByTimeLong 获得指定时间戳的月份.
GetMonthFirstDay 获得当前月份的第一天日期.
GetMonthFirstDayByMonth 获得指定月份的第一天日期.
GetMonthLastDay 获得当前月份的最后一天日期.
GetMonthLastDayByMonth 获得指定月份的最后一天日期.
GetNanosecondsFromTime 获取时间的纳秒数.
GetNextWeekday 获取下一个工作日.
GetPreviousWeekday 获取上一个工作日.
GetPreviousYearMonth 获得当前日期的上一个年月.
GetPreviousYearMonthBy 获得指定日期的前一个年月.
GetPublicIP 获取公网IP.
GetQuarterByMonth 获取指定月份所属的季度.
GetQuarterDay 获得当前季度的初始和结束日期.
GetQuarterRange 获取指定年份和季度的时间范围.
GetRemainingDuration 获取距离给定时间的剩余时间.
GetSecond 获得当前时间的秒数.
GetSecondByTimeInt 获得指定时间戳的秒数.
GetSecondByTimeLong 获得指定时间戳的秒数.
GetStartQuarter 获取每个季度的起始月份.
GetStartQuarterByMonth 获取指定月份所属季度的起始月份.
GetTime 根据类型和开始时间获取时间段及长度.
GetTimeByDay 获得当月指定日期的时间戳.
GetTimeByInt 时间戳转时间.
GetTimeByType 根据类型获取开始时间、结束时间及差值 1 天 2 周 3 月 4 年.
GetTimeFromUnixMilli 从毫秒级时间戳获取时间.
GetTimeMills 转为时间戳(毫秒数).
GetTimeTagGroup 获取当前日期字符串,结果:2024:05.
GetTimeUnix 转为时间戳(秒数).
GetTimeWithTimeZone 获取指定时区的时间.
GetTimeZone 获取当前时区.
GetUnixMilliFromTime 获取时间的毫秒级时间戳.
GetUTCTime 获取UTC时间.
GetWeek 获得当前时间的星期几(0-6,0表示星期日).
GetWeekByTimeInt 获得指定时间戳的星期几.
GetWeekByTimeLong 获得指定时间戳的星期几.
GetWeekDay 获取本周的开始时间和结束时间.
GetWeekOfYear 获取指定日期是所在年份的第几周.
GetWeekStr 获得周几字符串.
GetWeekStrByWeekInt 获得周几字符串.
GetYear 获得当前时间的年份.
GetYearByTimeInt 获得指定时间戳的年份.
GetYearByTimeLong 获得指定时间戳的年份.
GetYesterday 获取昨天日.
GetYesterdayInt 获取昨日时间戳.
Go runs the given function in a new goroutine with optional error handling.
InArray 判断字符串是否存在数组中.
No description provided by the author
IpInBlackListRange 判断IP是否在黑名单.
No description provided by the author
IsBetween 判断时间是否在两个时间之间.
IsDebugEnabled checks and returns whether debug mode is enabled.
IsEmpty checks whether `value` is empty.
IsExpired 判断给定时间是否已过期.
IsFloat checks whether `value` is type of float.
IsInt checks whether `value` is type of int.
IsJSONString 判断是否为JSON.
IsLeapYear 判断是否为闰年.
IsLetter 检查给定字节是否为字母.
IsLetterLower 检查给定字节是否为小写字母.
IsLetterUpper 检查给定字节是否为大写字母.
IsMap checks whether `value` is type of map.
IsNil checks whether `value` is nil, especially for interface{} type value.
IsNumeric 检查给定字符串是否为数字(包括浮点数).
IsSameDay 是否为同一天.
IsSameMinute 是否为同一分钟.
IsSlice checks whether `value` is type of slice.
IsStruct checks whether `value` is type of struct.
IsUint checks whether `value` is type of uint.
IsWeekend 判断给定时间是否为周末.
MapContainsPossibleKey checks if the given `key` is contained in given map `data`.
MapPossibleItemByKey tries to find the possible key-value pair for given key ignoring cases and symbols.
Now 获得当前时间.
ParseDuration 解析时间间隔字符串.
ParseIpRange 用于将以 "," 分割的多个 CIDR 范围字符串解析为 CIDR 数组。 如果一个 CIDR 范围是以 "-" 分割的两个 IP 地址,那么我们会使用 binaryToInt 和 intToIP 函数将它们转换为整数并再次转换为 CIDR 字符串, 并将其加入到 CIDR 数组中。.
ParsePrivateKeyFromPEM 从 PEM 格式的字节切片中解析 RSA 私钥.
ParsePublicKeyFromPEM 从 PEM 格式的字节切片中解析 RSA 公钥.
Rand 返回范围 [min, max] 内的随机整数.
RandFloat 返回范围 [min, max) 内的随机浮点数.
RandIntSlice 随机打乱整数切片.
RandLowerString 返回指定长度的随机小写字母字符串.
RandNumber 返回指定长度的随机数字字符串.
RandString 返回指定长度的随机字符串(包括字母和数字).
RandStringNoNumber 返回指定长度的随机字符串(仅包含字母).
RandUpperString 返回指定长度的随机大写字母字符串.
ReadExcelFile 读取EXCEL文件.
RemoveDuplicationMap 数组去重.
No description provided by the author
RemoveSymbols 移除字符串中的所有符号,只保留数字和字母.
Replace replaces all matched `pattern` in bytes `src` with bytes `replace`.
ReplaceByMap 使用映射表替换字符串中的内容.
ReplaceString replace all matched `pattern` in string `src` with string `replace`.
No description provided by the author
SavePrivateKeyToFile 将 RSA 私钥保存到文件.
SavePublicKeyToFile 将 RSA 公钥保存到文件.
SetDebugEnabled enables/disables the internal debug info.
SetTimeZone 设置时区.
SplitAndTrim 分割字符串并对每个部分进行修剪.
StartAndEndDayTime 获得时间戳对应的起始时间和结束时间.
StartAndEndMonthTime 获得指定时间戳的那个月的起始时间和结束时间.
StartAndEndWeekTime 获得指定时间戳的周一到周日的时间戳.
StartAndEndYearTime 获得指定时间戳的那年的起始时间和结束时间.
StripSlashes 移除字符串中的转义字符.
StrToTime 将字符串转时间戳.
StrToTimeFormat 将字符串转时间戳按格式.
StrToTimeFormatByLocal 将字符串转时间戳按格式和时区.
No description provided by the author
Throw throws out an exception, which can be caught be TryCatch or recover.
Time 获得当前时间戳单位s.
TimeByTime 获得时间戳.
TimeFormat 将当前时间转字符串.
TimeLong 获得当前时间戳到毫秒.
TimeLongToStr 将时间戳转字符串.
TimeToFormat 将时间戳转字符串并格式化.
TimeToStr 将时间戳转字符串.
ToExcel 生成io.ReadSeeker 参数 titleList 为Excel表头,dataList 为数据.
ToMultiSheetExcel 生成io.ReadSeeker 参数 titleList 为Excel表头,dataList 为数据,data 键为sheet.
Trim 去除字符串首尾的空白字符或指定字符.
Try implements try..
TryCatch implements `try...catch..`.
UcFirst 将字符串的第一个字母转换为大写.
UniqueCode 根据给定的 ID 和最小长度生成唯一码.
UTCTime 获得UTC时间字符串.
No description provided by the author
WalkDir 获取目录下文件的名称和大小.
ZeroTime 获得凌晨零点时间戳.
ZeroTimeByLocal 获得指定时区凌晨零点时间戳.
ZeroTimeByTime 获得时间戳对应的凌晨0点时间戳.
ZeroTimeByTimeByLocal 获得时间戳对应的凌晨0点时间戳(指定时区).
# Type aliases
ErrHandler is a function type for custom error handling.