Documentation ¶
Index ¶
- Variables
- func AddSecondToTime(second int64) (timestamp int64, Time time.Time, timeStr string)
- func AesDecrypt(encrypted []byte, key []byte) ([]byte, error)
- func AesDecryptByBase64(str string, key ...string) (string, error)
- func AesEncrypt(origData []byte, key []byte) ([]byte, error)
- func AesEncryptToBase64(str string, key ...string) (string, error)
- func AfterDayTime(day int) (timestamp int64, Time time.Time, timeStr string)
- func AfterMonthTime(month int) (timestamp int64, Time time.Time, timeStr string)
- func Base64Decode(str string) string
- func Base64Encode(str string) string
- func BeforeDayTime(day int) (timestamp int64, Time time.Time, timeStr string)
- func BeforeMonthTime(month int) (timestamp int64, Time time.Time, timeStr string)
- func CheckEmailRule(email string) bool
- func CheckIdNumRule(idNum string) bool
- func CheckIdNumRuleSimple(idNum string) bool
- func CheckMobileNumRule(mobile string) bool
- func CheckStringLength(str string, length int) bool
- func CreateOrderNo() (sn string)
- func DiyTimeFmtStr(format string, timestamps ...int64) string
- func DownInteger(f float64) float64
- func DownIntegerToInt64(f float64) int64
- func EarthDistance(lat1, lng1, lat2, lng2 float64, units ...string) float64
- func FileExists(path string) bool
- func FileGetContents(filename string) (str string, err error)
- func FilePutContentToAppend(filename string, data string) (err error)
- func FilePutContents(filename string, data string) error
- func Float32ToString(f float64) string
- func Float64ToInt64(f float64) int64
- func Float64ToString(f float64) string
- func FloatRound(f float64, n int) (res float64, err error)
- func GenerateOrderNo() string
- func GetBetweenDates(startDate, endDate string, layouts ...string) (d []string)
- func GetBetweenMonths(startDate, endDate string, layouts ...string) (d []string)
- func GetDay() (string, string)
- func GetMonthDay() (string, string)
- func GetQuarterDay() (string, string)
- func GetWeekDay() (string, string)
- func GetYearDay() (string, string)
- func IdCardBirthHandle(birth string, layouts ...string) (time.Time, error)
- func IdCardDeadlineHandle(date string, layouts ...string) (starTime, endTime time.Time, err error)
- func InSlice(slice []string, target string) bool
- func Int64ToFloat64(i64 int64) float64
- func Int64ToInt(i64 int64) int
- func Int64ToString(i64 int64) string
- func IntToInt64(i int) int64
- func InterceptDecimal(f float64, n int) float64
- func InterceptDecimalToString(f float64, n int) string
- func IsChinese(str string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func LcFirst(str string) string
- func LcWords(str string) (res string)
- func MapMerge(m1, m2 map[string]string) (m map[string]string)
- func Md5(str string) string
- func Md516(str string) string
- func NowDateTime() time.Time
- func NowDateTimeFmtStr() string
- func NowDateTimeStr() string
- func NowTime() (timestamp int64, Time time.Time, timeStr string)
- func NowTimeSplit() (ymd, hms string)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) ([]byte, error)
- func RandString() string
- func RemoveInvalid0(f float64) float64
- func RemoveInvalid0ToString(f float64) string
- func Ripemd160(str string) string
- func RoundFloat(f float64, n int) (res float64, err error)
- func RoundToString(f float64, n int) string
- func Sha1(str string) string
- func Sha256(str string) string
- func Sha512(str string) string
- func SpellReadNum(str string, formats ...SpellDigitalFormat) (slice []string, err error)
- func StrLengthCutAndSplitJoint(str string, cutLength int, splitJointStr ...string) string
- func StringToFloat64(s string) (float64, error)
- func StringToInt64(str string) (int64, error)
- func SubDays(t1, t2 time.Time) (day int)
- func SubMonth(t1, t2 time.Time) (month int)
- func SubMonths(t1, t2 time.Time) (month int)
- func TimeSplit(t time.Time) (ymd, hms string)
- func TimeStrToTime(str string) (timestamp int64, Time time.Time)
- func TimestampToTime(timestamp int64) (Time time.Time, timeStr string)
- func ToBigCamelCase(str string, signs ...string) (res string)
- func ToSmallCamelCase(str string, signs ...string) (res string)
- func TodayDateTimeEnd() (timestamp int64, Time time.Time, timeStr string)
- func TodayDateTimeStart() (timestamp int64, Time time.Time, timeStr string)
- func UcFirst(str string) string
- func UcWords(str string) (res string)
- func UniqueId(v ...interface{}) string
- func UpInteger(f float64) float64
- func UpIntegerToInt64(f float64) int64
- func UrlDecode(str string) string
- func UrlEncode(str string) string
- type SpellDigitalFormat
Constants ¶
This section is empty.
Variables ¶
var ( TimeLayoutYMDHIS string = "20060102150405" TimeLayout string = "2006-01-02 15:04:05" TimeLayoutYMD string = "2006-01-02" TimeLayoutHMS string = "15:04:05" )
Functions ¶
func AddSecondToTime ¶ added in v0.0.3
AddSecondToTime 在当前时间戳的基础上加上秒数,重新生成时间日期
func AesDecrypt ¶ added in v0.0.6
AesDecrypt AES解密
func AesDecryptByBase64 ¶ added in v0.6.5
AesDecryptByBase64 对Base64格式的字符串解密
func AesEncrypt ¶ added in v0.0.6
AesEncrypt AES加密
func AesEncryptToBase64 ¶ added in v0.6.5
AesEncryptToBase64 加密后为Base64格式的字符串
func AfterDayTime ¶ added in v0.1.3
AfterDayTime N天后的时间
func AfterMonthTime ¶ added in v0.5.0
AfterMonthTime N月后的时间
func BeforeDayTime ¶ added in v0.0.17
BeforeDayTime N天前的时间
func BeforeMonthTime ¶ added in v0.5.0
BeforeMonthTime N月前的时间
func CheckIdNumRule ¶ added in v0.0.2
CheckIdNumRule 验证身份证号码的合法性
func CheckIdNumRuleSimple ¶ added in v0.0.19
CheckIdNumRuleSimple 简单校验身份证号码的位数+组成字符
func CheckMobileNumRule ¶ added in v0.0.2
CheckMobileNumRule 验证手机号码
func CheckStringLength ¶ added in v0.0.14
CheckStringLength 判断字符串长度是否在规定范围内
func CreateOrderNo ¶ added in v0.1.0
func CreateOrderNo() (sn string)
CreateOrderNo 生成平台32位订单号 [不推荐使用]
func DiyTimeFmtStr ¶ added in v0.1.2
DiyTimeFmtStr Diy时间格式
func DownIntegerToInt64 ¶ added in v0.4.4
DownIntegerToInt64 向下取整返回int64
func EarthDistance ¶ added in v0.3.2
EarthDistance 两点之间的距离,不分前后[默认单位:米]
func FileGetContents ¶ added in v0.5.3
FileGetContents 把整个文件读入一个字符串中
func FilePutContentToAppend ¶ added in v0.5.6
FilePutContentToAppend 把一个字符串写入文件中[追加至原文件]
func FilePutContents ¶ added in v0.5.3
FilePutContents 把一个字符串写入文件中[覆盖原文件内容]
func Float32ToString ¶ added in v0.0.2
Float32ToString float32转string
func Float64ToInt64 ¶ added in v0.2.9
Float64ToInt64 float64转int64
func Float64ToString ¶ added in v0.0.2
Float64ToString float64转string
func FloatRound ¶ added in v0.2.2
FloatRound 四舍五入 [n为保留的小数点位数] [不优先使用]
func GenerateOrderNo ¶ added in v0.4.0
func GenerateOrderNo() string
GenerateOrderNo 生成24位订单号 [前面17位代表时间精确到毫秒,中间3位代表进程id,最后4位代表序号]
func GetBetweenDates ¶ added in v0.3.5
GetBetweenDates 根据开始日期和结束日期计算出时间段内所有日期[两个日期内所有天数]
func GetBetweenMonths ¶ added in v0.4.5
GetBetweenMonths 根据开始日期和结束日期计算出时间段内所有月份
func GetQuarterDay ¶ added in v0.3.3
GetQuarterDay 获得当前季度的初始和结束日期
func IdCardBirthHandle ¶ added in v0.6.2
IdCardBirthHandle 身份证出生日期处理,统一格式:[2020年1月1日]
func IdCardDeadlineHandle ¶ added in v0.6.5
IdCardDeadlineHandle 身份证有效期处理,统一格式:[2018.08.01-2028.08.01]
func Int64ToFloat64 ¶ added in v0.2.9
Int64ToFloat64 int64转float64
func Int64ToString ¶ added in v0.0.2
Int64ToString int64转string
func InterceptDecimal ¶ added in v0.2.2
InterceptDecimal 不四舍五入截取小数点 [n为保留的小数点数]
func InterceptDecimalToString ¶ added in v0.2.5
InterceptDecimalToString 不四舍五入截取小数点后为字符串格式 [n为保留的小数点数]
func PKCS7Padding ¶ added in v0.0.6
PKCS7Padding PKCS7 填充模式
func PKCS7UnPadding ¶ added in v0.0.6
PKCS7UnPadding 填充的反向操作,删除填充字符串
func RemoveInvalid0ToString ¶ added in v0.2.9
RemoveInvalid0ToString 去掉无效的0并转为字符串格式
func RoundFloat ¶ added in v0.2.2
RoundFloat 四舍五入 [n为保留的小数点位数] [优先使用]
func RoundToString ¶ added in v0.2.5
RoundToString 四舍五入后为字符串格式 [n为保留的小数点位数]
func SpellReadNum ¶ added in v0.0.18
func SpellReadNum(str string, formats ...SpellDigitalFormat) (slice []string, err error)
SpellReadNum 拼读数
func StrLengthCutAndSplitJoint ¶ added in v0.0.13
StrLengthCutAndSplitJoint 字符串长度截取并拼接处理
func StringToFloat64 ¶ added in v0.2.7
StringToFloat64 string转float64
func StringToInt64 ¶ added in v0.2.9
StringToInt64 string转int64
func TimeStrToTime ¶ added in v0.0.2
TimeStrToTime 将时间字符串转为时间戳和time.Time(例如:2021-08-08 08:08:08)
func TimestampToTime ¶ added in v0.0.4
TimestampToTime 时间戳转日期格式
func ToBigCamelCase ¶ added in v0.2.4
ToBigCamelCase 字符串转大驼峰格式
func ToSmallCamelCase ¶ added in v0.2.4
ToSmallCamelCase 字符串转小驼峰格式
func TodayDateTimeEnd ¶ added in v0.2.0
TodayDateTimeEnd 今日23:59:59时间
func TodayDateTimeStart ¶ added in v0.2.0
TodayDateTimeStart 今日00:00:00时间
func UpIntegerToInt64 ¶ added in v0.4.4
UpIntegerToInt64 向上取整返回int64
Types ¶
type SpellDigitalFormat ¶ added in v0.4.3
SpellDigitalFormat 拼读格式