package
0.0.0-20240709013227-3d713be65c8d
Repository: https://github.com/bodii/go-gin-gorm-project-template.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
generates client ip param: - r [*http.Request]: http request return: - [string]: ip value.
copy file func param: - dst [string]: the target path to save the file - src [string]: source storage path of the file return: - err [error]: error info.
ServerJSON : json error server response function.
generates an uppercase token value for the current hour param: - data [string]: a string value return: - [string]: the generated upper token encryted value.
GetApiPublicParamsAllMap 获取所有公共参数的map形式.
GetApiPublicParamsToUserid 获取公共参数中的accountId.
GetEnvSecretValue get secret key return: - [string]: the secret value in .env file or default "secret".
generates an md5 encrypted value for nanoseconds param: return: - [string]: the generated md5 string.
No description provided by the author
gets a Rand handle for random nanoseconds param: return: - [*rand.Rand] rand handle.
get upload file path param: - pathTag [string]: tag of the save path - filename [string]: filename of the save file return: - [string]: path to save the file.
No description provided by the author
ISChinese func param: - str string.
IsEnglish func param: - str string.
verify that the string value is a cell phone number param: - str [string]: a string value that may contain the phone number return: - [bool] this is a mobile: true|false.
IsNumber func param: str string returns: this is a number: true|false.
get a string md5 value param: - data [string]: a string data return: - [string]: the generated md5 string.
generate a salted password param: - pwd [string]: password value - salt [string]: the value of the salt property return: - [string]: the generated md5 string.
generate md5 value after many times param: - data [string]: a string data - n [int]: number of times to md5 return: - [string]: the generated md5 string.
generates the uppercase value of the string after md5 param: - data [string]: a string data return: - [string]: the generated upper md5 string.
combine multiple pictures into one picture param: - dst [string]: to save the composited image address - canvasWidth [int]: to save the canvas width - spacingWidth [int]: the spacing when stitching pictures together - columnNum [int]: how many columns are displayed in each row - background [color.Color]: the background color of the picture to save - images [ []string ]: which images to merge return: - void.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
create QrCode func param: - url [string]: QR Code to url addr.
RandFileName func param: - suffix the affix of the file name to be generated.
RandSlice 随机打乱Slice,并从中抽取count个元素.
func RandStr params: [ length int ] rand string length [ level int ] 1:小写字母; 2:大写字母; 3:数字; 4:小写字母+大写字母; 5:小写字母+大写字母+数字; 6:小写字母+大写字母+数字+特殊字符 <= returns : a random string of length and level.
No description provided by the author
No description provided by the author
Read the configuration content of a toml file type @this is a generic func [T] param: - file [string]: a string file path return: - [T]: type.
Read the configuration content of a yaml file type @this is a generic func [T] param: - file [string]: a string file path return: - [T]: type.
No description provided by the author
ResponseJSON : json response function.
SortMapByKey sort map by key.
SortMapByKeyToKeys sort map by key to keys For example: m := map[string]any{ "a": 1, "c": 3, "b": 2, } keys := SortMapByKeyToKeys(m, SortOrderAsc) fmt.Println(keys) Output: [a b c].
SortMapByValueToKeys sort map by value to keys For example: m := map[string]int{ "a": 1, "v": 3, "p": 2, } keys := SortMapByValueToKeys(m, SortOrderAsc) fmt.Println(keys) Output: [a p v].
get str prefix param: - str string.
func UpdateTime see https://pkg.go.dev/time#pkg-constants params: <= returns : e.g.
get a default profile picture based on gender param: - sex [int]: sex value return: - filename [string]: filename of the save file.
verify that the password is valid param: - newPwd [string]: input password value - salt [string]: the value of the salt property - oldPwdAndSalt [string]: contains the password after salt and password return: - [bool]: determine whether the new salted password is the same as the old password after encryption.

# Constants

小写字母[a-z], length: 26.
大写字母[A-Z], length: 26.
数字字符串[01...9], length: 10.
小写字母[a-z] + 大写字母[A-Z], length: 52.
小写字母[a-z] + 大写字母[A-Z] + 数字[01...9], length: 62.
小写字母[a-z] + 大写字母[A-Z] + 数字[01...9] + 特殊字符, length: 82.
SortOrderAsc sort order asc.
SortOrderDesc sort order desc.

# Structs

No description provided by the author
No description provided by the author
Response struct.
SortMapPair sort map pair.

# Interfaces

No description provided by the author

# Type aliases

SortOrderT sort order mode(asc/desc) type.