Documentation ¶
Index ¶
- Variables
- type AesUtil
- func (au AesUtil) AesDecrypt(data []byte, key string) ([]byte, error)
- func (au AesUtil) AesEncrypt(data []byte, key string) ([]byte, error)
- func (au AesUtil) Decrypt(data string, key string) string
- func (au AesUtil) DecryptBase64(data string, key string) string
- func (au AesUtil) Encrypt(data string, key string) string
- func (au AesUtil) EncryptBase64(data string, key string) string
- type Base64Util
- type CachePool
- func (cp CachePool) Add(cacheInfo model.CacheInfo) *model.MsgEmity
- func (cp CachePool) AddData(sId string, data interface{}) *model.MsgEmity
- func (cp CachePool) Clear() *model.MsgEmity
- func (cp CachePool) Contains(sId string) bool
- func (cp CachePool) Find(sId string) *model.CacheInfo
- func (cp CachePool) FindData(sId string) interface{}
- func (cp CachePool) Free(sId string) *model.MsgEmity
- func (cp CachePool) FreeByData(data interface{}) *model.MsgEmity
- func (cp CachePool) FreeById(sId string) *model.MsgEmity
- func (cp CachePool) FreeByTime(iMinute int) *model.MsgEmity
- type CacheTxtUtil
- func (ctu CacheTxtUtil) CreateCacheFile(object interface{}, sCacheFile string) *model.MsgEmity
- func (ctu CacheTxtUtil) CreateCacheFileByList(list []interface{}, sCacheFile string) *model.MsgEmity
- func (ctu CacheTxtUtil) DelCacheFile(sCacheFile string) *model.MsgEmity
- func (ctu CacheTxtUtil) ReadCacheFile(sCacheFile ...string) []interface{}
- type FloatUtil
- type IntegerUtil
- type IpUtil
- type JsonUtil
- func (ju JsonUtil) ArrayFromFile(path string) ([]map[string]interface{}, error)
- func (ju JsonUtil) FormFile(path string, entity interface{}) *model.MsgEmity
- func (ju JsonUtil) JsonToMap(jsonStr string) (map[string]string, error)
- func (ju JsonUtil) MapFromFile(path string) (map[string]interface{}, error)
- func (ju JsonUtil) ToFile(data interface{}, path string) bool
- func (ju JsonUtil) ToMap(jsonStr string) (map[string]interface{}, error)
- func (ju JsonUtil) ToObj(str string, entity interface{}) *model.MsgEmity
- func (ju JsonUtil) ToStr(data interface{}) string
- type LocalTime
- type MapUtil
- type Md5
- type RiotUtil
- type SequenceUtil
- type Sha256Util
- func (su Sha256Util) GenRsaKey() (string, string, error)
- func (su Sha256Util) RsaDecrypt(ciphertext, keyBytes string) (string, error)
- func (su Sha256Util) RsaEncrypt(data, keyBytes string) (string, error)
- func (su Sha256Util) RsaSignWithSha256(data, keyBytes string) (string, error)
- func (su Sha256Util) RsaVerySignWithSha256(data, signData, keyBytes string) (bool, error)
- type StringUtil
- func (su StringUtil) Append(data ...interface{}) string
- func (su StringUtil) Byte2Str(b []byte) string
- func (su StringUtil) ChangeBetween(source, beginStr, endStr, newStr string, lastIndexOf bool) string
- func (this StringUtil) DelStr(source string, sub ...string) string
- func (su StringUtil) FirstLower(s string) string
- func (su StringUtil) FirstUpper(s string) string
- func (su StringUtil) Has(source, str string) bool
- func (su StringUtil) HasEnd(str, end string) bool
- func (su StringUtil) HasStart(str, start string) bool
- func (this StringUtil) HasStr(data interface{}, str string) bool
- func (su StringUtil) IsAllChineseChar(str string) bool
- func (su StringUtil) IsCompriseChineseChar(str string) bool
- func (su StringUtil) IsLowerStart(s string) bool
- func (su StringUtil) IsUpperStart(s string) bool
- func (su StringUtil) Lower(str string) string
- func (su StringUtil) RemoveBetween(source, beginStr, endStr string, lastIndexOf bool) string
- func (this StringUtil) ReplaceAll(source, old, new string) string
- func (su StringUtil) SubBetween(source, beginStr, endStr string, lastIndexOf bool) string
- func (su StringUtil) SubMaxStr(source string, beginIndex, endMaxIndex int) string
- func (this StringUtil) SupplyZero(formatLong int, data interface{}) string
- func (su StringUtil) ToStr(data interface{}) string
- func (su StringUtil) Trim(str string) string
- func (su StringUtil) TrimAttribute(data map[string]interface{})
- func (su StringUtil) Upper(str string) string
- type TimeUtil
- func (tu TimeUtil) Add(date time.Time, iT ...int) time.Time
- func (tu TimeUtil) AddDay(date time.Time, iCount int) time.Time
- func (tu TimeUtil) AddHour(date time.Time, iCount int) time.Time
- func (tu TimeUtil) AddMinute(date time.Time, iCount int) time.Time
- func (tu TimeUtil) AddMonth(date time.Time, iCount int) time.Time
- func (tu TimeUtil) AddYear(date time.Time, iCount int) time.Time
- func (tu TimeUtil) Current(formatStr ...string) string
- func (tu TimeUtil) Format(date time.Time, formatStr string) string
- func (tu TimeUtil) GapDay(t1, t2 interface{}) (day int)
- func (tu TimeUtil) GapHour(t1, t2 interface{}) (hour int)
- func (tu TimeUtil) GapMinute(t1, t2 interface{}) (hour int)
- func (tu TimeUtil) GapMonth(t1, t2 interface{}) (month int)
- func (tu TimeUtil) GapYear(t1, t2 interface{}) (year int)
- func (tu TimeUtil) IsTime(str string) bool
- func (tu TimeUtil) MilliSecond() int64
- func (tu TimeUtil) NanoSecond() int64
- func (tu TimeUtil) Second() int64
- func (tu TimeUtil) ToDate(str string) time.Time
- func (tu *TimeUtil) ToStr() string
- func (tu TimeUtil) Today(formatStr ...string) string
- func (tu TimeUtil) TodayEd() string
- func (tu TimeUtil) TodaySt() string
- type U62Util
- type UUIDUtil
Constants ¶
This section is empty.
Variables ¶
View Source
var ( U62UtilLock sync.Mutex //保存锁 U62UtilNumber = 0 //序号 U62UtilArray map[int]string = map[int]string{ 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", 10: "a", 11: "b", 12: "c", 13: "d", 14: "e", 15: "f", 16: "g", 17: "h", 18: "i", 19: "j", 20: "k", 21: "l", 22: "m", 23: "n", 24: "o", 25: "p", 26: "q", 27: "r", 28: "s", 29: "t", 30: "u", 31: "v", 32: "w", 33: "x", 34: "y", 35: "z", 36: "A", 37: "B", 38: "C", 39: "D", 40: "E", 41: "F", 42: "G", 43: "H", 44: "I", 45: "J", 46: "K", 47: "L", 48: "M", 49: "N", 50: "O", 51: "P", 52: "Q", 53: "R", 54: "S", 55: "T", 56: "U", 57: "V", 58: "W", 59: "X", 60: "Y", 61: "Z"} )
View Source
var (
CacheTxtUtilLock sync.Mutex //同步锁
)
View Source
var (
SequenceUtilLock sync.Mutex //同步锁
)
Functions ¶
This section is empty.
Types ¶
type AesUtil ¶
type AesUtil struct{}
func (AesUtil) AesDecrypt ¶
AesDecrypt 解密
func (AesUtil) AesEncrypt ¶
AesEncrypt 加密
func (AesUtil) DecryptBase64 ¶
DecryptByAes Aes 解密
type Base64Util ¶
type Base64Util struct{}
func (Base64Util) Base64ToPng ¶
func (Base64Util) Base64ToPng(base64Data, savePath string) *model.MsgEmity
Base64转换为PNG图片
type CachePool ¶
type CachePool struct{}
自定义缓存池
func (CachePool) FreeByData ¶
* * 释放缓存 * @param sId * @return
type CacheTxtUtil ¶
type CacheTxtUtil struct{}
func (CacheTxtUtil) CreateCacheFile ¶
func (ctu CacheTxtUtil) CreateCacheFile(object interface{}, sCacheFile string) *model.MsgEmity
*
- 创建缓存文件
- @param object 待存储数据对象
- @param sCacheFile 缓存文件路径及文件名
- @return
func (CacheTxtUtil) CreateCacheFileByList ¶
func (ctu CacheTxtUtil) CreateCacheFileByList(list []interface{}, sCacheFile string) *model.MsgEmity
*
- 创建缓存文件
- @param list 数据集合
- @param sCacheFile 缓存文件路径及文件名
- @return
func (CacheTxtUtil) DelCacheFile ¶
func (ctu CacheTxtUtil) DelCacheFile(sCacheFile string) *model.MsgEmity
*
- 删除缓存文件
- @param sCacheFile
func (CacheTxtUtil) ReadCacheFile ¶
func (ctu CacheTxtUtil) ReadCacheFile(sCacheFile ...string) []interface{}
*
- 读取缓存文件
- @param sCacheFile 缓存文件路径及文件名
- @return
type IntegerUtil ¶
type IntegerUtil struct{}
func (IntegerUtil) ToInt ¶
func (iu IntegerUtil) ToInt(obj interface{}, iDefault ...int) int
对象(字符串)转整型
func (IntegerUtil) ToInt64 ¶
func (iu IntegerUtil) ToInt64(obj interface{}, iDefault int64) int64
对象(字符串)转64整型
type JsonUtil ¶
type JsonUtil struct{}
func (JsonUtil) ArrayFromFile ¶
文件转JsonArray
func (JsonUtil) MapFromFile ¶
文件转map
type MapUtil ¶
type MapUtil struct{}
func (MapUtil) RemoveData ¶
移除指定键
type SequenceUtil ¶
type SequenceUtil struct{}
func (SequenceUtil) Get ¶
func (su SequenceUtil) Get() string
* * 取时间显示式的流水号 * @return 返回形式举例:20200521094216048001
func (SequenceUtil) GetSequence ¶
func (su SequenceUtil) GetSequence(iMaxLength int, prefix ...string) string
* * 取指定长度的流水号 * @param iMaxLength 指定长度 * @param prefix 前缀 * @return
func (SequenceUtil) GetSeriesNum ¶
func (su SequenceUtil) GetSeriesNum(prefix string) string
* * 取累计值(有代码锁) * @param prefix 前缀 * @return
type Sha256Util ¶
type Sha256Util struct{}
func (Sha256Util) RsaDecrypt ¶
func (su Sha256Util) RsaDecrypt(ciphertext, keyBytes string) (string, error)
私钥解密
func (Sha256Util) RsaEncrypt ¶
func (su Sha256Util) RsaEncrypt(data, keyBytes string) (string, error)
公钥加密
func (Sha256Util) RsaSignWithSha256 ¶
func (su Sha256Util) RsaSignWithSha256(data, keyBytes string) (string, error)
签名
func (Sha256Util) RsaVerySignWithSha256 ¶
func (su Sha256Util) RsaVerySignWithSha256(data, signData, keyBytes string) (bool, error)
验证
type StringUtil ¶
type StringUtil struct{}
func (StringUtil) ChangeBetween ¶
func (su StringUtil) ChangeBetween(source, beginStr, endStr, newStr string, lastIndexOf bool) string
*
- 替换指定字符串间的内容(仅一次),并返回新值
- @param source 源
- @param beginStr 开始字符串
- @param endStr 结束字符串
- @param newStr 新字符串
- @param lastIndexOf 是否从后面开始去截取字符串
- @return
func (StringUtil) DelStr ¶
func (this StringUtil) DelStr(source string, sub ...string) string
*
- 彻底替换指定内容
- @param source 源字符串
- @param sub 待删除子字符串
- @return
func (StringUtil) HasStr ¶
func (this StringUtil) HasStr(data interface{}, str string) bool
*
- 判断是否存在字符串
- @param str
- @return
func (StringUtil) IsAllChineseChar ¶
func (su StringUtil) IsAllChineseChar(str string) bool
*
- 是否全中文,全中文返回true
- @param str
- @return
func (StringUtil) IsCompriseChineseChar ¶
func (su StringUtil) IsCompriseChineseChar(str string) bool
*
- 是否包含中文,含中文返回true
- @param str
- @return
func (StringUtil) RemoveBetween ¶
func (su StringUtil) RemoveBetween(source, beginStr, endStr string, lastIndexOf bool) string
*
- 移除指定字符串间的内容(仅一次),并返回新值
- @param source 源
- @param beginStr 开始字符串
- @param endStr 结束字符串
- @param lastIndexOf 是否从后面开始去截取字符串
- @return
func (StringUtil) ReplaceAll ¶
func (this StringUtil) ReplaceAll(source, old, new string) string
*
- 彻底替换指定内容
- @param source
- @param old
- @param new
- @return
func (StringUtil) SubBetween ¶
func (su StringUtil) SubBetween(source, beginStr, endStr string, lastIndexOf bool) string
*
- 截取指定字符串间的内容
- @param source 源
- @param beginStr 开始字符串
- @param endStr 结束字符串
- @param lastIndexOf 是否从后面开始去截取字符串
- @return
func (StringUtil) SubMaxStr ¶
func (su StringUtil) SubMaxStr(source string, beginIndex, endMaxIndex int) string
*
- 截取字符串
- @param source 源字符串
- @param beginIndex 开始位置 0开始
- @param endMaxIndex 最大结束位置,超出则取字符串最大位置
- @return
func (StringUtil) SupplyZero ¶
func (this StringUtil) SupplyZero(formatLong int, data interface{}) string
*
- 彻底替换指定内容
- @param formatLong
- @param data
- @return
func (StringUtil) TrimAttribute ¶
func (su StringUtil) TrimAttribute(data map[string]interface{})
清理map中字符串类型数据的前后空格
type TimeUtil ¶
type TimeUtil struct{}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
aesutil
module
|
|
base64util
module
|
|
cachepoolutil
module
|
|
floatutil
module
|
|
integerutil
module
|
|
iputil
module
|
|
jsonutil
module
|
|
maputil
module
|
|
md5util
module
|
|
mdutil
module
|
|
riotutil
module
|
|
sequenceutil
module
|
|
sha256util
module
|
|
stringutil
module
|
|
timeutil
module
|
|
u64util
module
|
|
uuidutil
module
|
Click to show internal directories.
Click to hide internal directories.