Versions in this module Expand all Collapse all v1 v1.0.0 Sep 1, 2022 Changes in this version + var NumberLetters = []string + var RegexY = regexp.Compile(`^\d{4}$`) + var RegexYM = regexp.Compile(`^\d{4}-\d{2}$`) + var RegexYMD = regexp.Compile(`^\d{4}-\d{2}-\d{2}$`) + var RegexYMDHI = regexp.Compile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$`) + var RegexYMDHIS = regexp.Compile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$`) + func Base64Encode(str string) string + func CamelToCase(name string) string + func ConvertStr(value interface{}) string + func CosDeleteFile(conf config.CosConfig, key string) error + func CosGetCredential(conf config.CosConfig, folder string, action []string) (*sts.CredentialResult, error) + func CosGetUploadCredential(conf config.CosConfig, folder string) (*sts.CredentialResult, error) + func CosNewClient(conf config.CosConfig, action []string) (*cos.Client, error) + func CosUploadFile(conf config.CosConfig, key string, file string) error + func CosUploadRemoteFile(conf config.CosConfig, key string, remoteUrl string) error + func CosUploadStreamFile(conf config.CosConfig, key string, stream io.Reader) error + func CurrentDateTime() (microDate int64, microTime int64) + func DiscountText(val float32, dft ...string) string + func FenToYuan(val int, thousandth ...bool) string + func Float32ToString(val float32) string + func Float64ToString(val float64) string + func FormatMicroDateTimeShortString(value int64, format string, sep string) (text string) + func FormatMicroTime(value int64, format ...string) string + func FormatMicroTimeShortString(value int64) (text string) + func FormatSecondTime(value int64, format ...string) string + func GetFirstDateOfWeek() (weekMonday string) + func GetPost(c *gin.Context, key string) *queryFormData + func GetPostArray(c *gin.Context, key string) *queryFormDataArray + func GetQuery(c *gin.Context, key string) *queryFormData + func GetQueryArray(c *gin.Context, key string) *queryFormDataArray + func GetTodayStartMircoTime() int64 + func GetTodayStartSecondTime() int64 + func Hex16ToFloat64(bys []byte) float64 + func Hex16ToInt(bys []byte) int + func Hex16ToInt64(bys []byte) int64 + func Hex16ToUint64(bys []byte) uint64 + func HexIEEE754ToFloat(bys []byte) float64 + func HttpBuildQuery(data map[string]interface{}) string + func HttpGet(accessUrl string, option *HttpClientOptions) (response []byte, ex *exception.Error) + func HttpPostFile(url string, filename string) ([]byte, *exception.Error) + func HttpPostForm(accessUrl string, option *HttpClientOptions) (response []byte, ex *exception.Error) + func HttpPostString(accessUrl string, option *HttpClientOptions) (response []byte, ex *exception.Error) + func HttpPostString1(url string, data string) ([]byte, *exception.Error) + func InArrayByFloat64(val float64, arr []float64) bool + func InArrayByInt(val int, arr []int) bool + func InArrayByInt64(val int64, arr []int64) bool + func InArrayByStr(val string, arr []string) bool + func InetAtoN(ip string) int64 + func InetNtoA(ip int64) string + func Int64ArrayDiff(array1 []int64, othersParams ...[]int64) []int64 + func Int64ArrayIntersect(array1 []int64, othersParams ...[]int64) []int64 + func Int64ToFloat32(val int64) float32 + func Int64ToFloat64(val int64) float64 + func Int64ToString(val int64) string + func IntAConvStrA(data []int) (result []string) + func IntArrayDiff(array1 []int, othersParams ...[]int) []int + func IntArrayIntersect(array1 []int, othersParams ...[]int) []int + func IntToFloat32(val int) float32 + func IntToFloat64(val int) float64 + func IntToHex16(num interface{}) []byte + func IntToHex36(num int) string + func IntToString(val int) string + func Is32BitCode(val string) (match bool) + func IsEmpty(val interface{}) bool + func IsLetter(val string) (match bool) + func IsLetterAndNumber(val string) (match bool) + func IsNumber(val string) (match bool) + func IsNumeric(val string) (match bool) + func IsTextKey(val string) (match bool) + func JsonToMap(str string) (map[string]interface{}, error) + func JsonToString(val interface{}) string + func KSort(data map[string]interface{}) map[string]interface + func MD5(str string) string + func MD5RAW(str string) string + func MD5Sign(dict map[string]interface{}, secret string) (sign string) + func MD5withKEY(str string, key string) string + func MicroTime() int64 + func MicroTimeDate() int64 + func MicroTimeHour() int64 + func MicroTimeMinute() int64 + func PKCS7UnPadding(plantText []byte) []byte + func Paginate(c *gin.Context, defaultSize ...int) (int, int) + func PrintJSON(val interface{}) + func RandomInt64(nums int) int64 + func RandomString(nums int) string + func RemoteIp(c *gin.Context) string + func RemoveDuplicatesAndEmpty(data []string) (ret []string) + func SHA1(str string) string + func SHA1HMAC(key string, str string) string + func SHA256(str string) string + func SecondTime() int64 + func StrAConvIntA(data []string) (result []int) + func StringArrayDiff(array1 []string, othersParams ...[]string) []string + func StringArrayIntersect(array1 []string, othersParams ...[]string) []string + func StringToFloat64(val string) float64 + func StringToInt(val string) int + func StringToInt64(val string) int64 + func StringToJson(val string, target interface{}) + func StringToTime(str string) int64 + func StringToXml(val string, target interface{}) + func Thousandth(val interface{}) string + func ThousandthDecimals(val interface{}, decimals int) string + func WxCodeToSession(code string, conf config.WeiXinMcpConfig) ([]byte, *exception.Error) + func WxCreateMpMenu(menu string, accessToken string) *exception.Error + func WxCreateQrcodeUnlimited(sceneId string, page string, width int, accessToken string) ([]byte, *exception.Error) + func WxGetAccessToken(redis *redis.Client, conf config.WeiXinMcpConfig, force bool) (string, *exception.Error) + func WxSendMpContent(openId string, accessToken string, msgtype string, data string) *exception.Error + func WxShowQrCode(ticket string) string + func XmlToString(val interface{}) string + type HttpClientOptions struct + CookieUrl *url.URL + Cookies []*http.Cookie + FormData map[string]string + Headers map[string]string + Proxy string + SslSkipVerify bool + Timeout time.Duration + type Int64Array []int64 + func (arr Int64Array) InArray(val int64) bool + type Int64Int64Map map[int64]int64 + func (m Int64Int64Map) GetKVS() (keys []int64, values []int64) + func (m Int64Int64Map) GetKeys() []int64 + func (m Int64Int64Map) GetValues() []int64 + type Int64IntMap map[int64]int + func (m Int64IntMap) GetKeys() []int64 + func (m Int64IntMap) GetValues() []int + type Int64StringMap map[int64]string + func (m Int64StringMap) GetKVS() (keys []int64, values []string) + func (m Int64StringMap) GetKeys() []int64 + func (m Int64StringMap) GetValues() []string + type IntArray []int + func (arr IntArray) InArray(val int) bool + type IntBoolMap map[int]bool + func (m IntBoolMap) GetKeys() []int + type IntInt64Map map[int]int64 + func (m IntInt64Map) GetKVS() (keys []int, values []int64) + func (m IntInt64Map) GetKeys() []int + func (m IntInt64Map) GetValues() []int64 + type IntIntMap map[int]int + func (m IntIntMap) GetKVS() (keys []int, values []int) + func (m IntIntMap) GetKeys() []int + func (m IntIntMap) GetValues() []int + type IntStringMap map[int]string + func (m IntStringMap) GetKVS() (keys []int, values []string) + func (m IntStringMap) GetKeys() []int + func (m IntStringMap) GetValues() []string + type StrArray []string + func (arr StrArray) InArray(val string) bool + type StringBoolMap map[string]bool + func (m StringBoolMap) GetKeys() []string + type StringIntMap map[string]int + func (m StringIntMap) GetKVS() (keys []string, values []int) + func (m StringIntMap) GetKeys() []string + func (m StringIntMap) GetValues() []int + type StringStringMap map[string]string + func (m StringStringMap) GetKVS() (keys []string, values []string) + func (m StringStringMap) GetKeys() []string + func (m StringStringMap) GetPairs() (pairs []string) + func (m StringStringMap) GetValues() []string + type TimeInt64Data struct + Value int64 + func GetTimeInt64(val int64) *TimeInt64Data + func (d *TimeInt64Data) NextDay() int64 + func (d *TimeInt64Data) NextMonth() int64 + func (d *TimeInt64Data) NextYear() int64 + func (d *TimeInt64Data) PrevDay() int64 + func (d *TimeInt64Data) PrevMonth() int64 + func (d *TimeInt64Data) PrevYear() int64 + type TimeStringData struct + Value string + func GetTimeString(val string) *TimeStringData + func (d *TimeStringData) CurrentMonthFirstDayMicroTime() int64 + func (d *TimeStringData) CurrentYearFirstMonthMicroTime() int64 + func (d *TimeStringData) DateTime() *time.Time + func (d *TimeStringData) MicroTime() int64 + func (d *TimeStringData) SecondTime() int64 + type WxAccessTokenData struct + AccessToken string + ExpiresIn time.Duration + type WxBizDataCrypt struct + AppId string + SessionKey string + func (wxCrypt *WxBizDataCrypt) Decrypt(encryptedData string, iv string, isJSON bool) (interface{}, *WxResponseErrorData) + type WxMediaData struct + MediaId string + Url string + func WxAddMaterial(file string, accessToken string, fileType string) (*WxMediaData, *exception.Error) + type WxQrcodeData struct + ExpireSeconds int + Ticket string + Url string + func WxCreateQrcode(sceneId string, accessToken string) (*WxQrcodeData, *exception.Error) + type WxQrcodeUnlimitedData struct + Buffer string + ContentType string + type WxResponseErrorData struct + ErrCode int + ErrMsg string + type WxUploadData struct + CreatedAt int + MediaId string + Type string + func WxUploadFile(file string, accessToken string, fileType string) (*WxUploadData, *exception.Error) + type WxUserInfoData struct + HeadImgUrl string + Nickname string + Openid string + Sex int64 + Subscribe int64 + SubscribeTime int64 + UnionId string + func WxGetUserInfo(openId string, accessToken string) (*WxUserInfoData, *exception.Error)