package
0.0.0-20201029024727-40ba3189a192
Repository: https://github.com/team4yf/fpm-go-pkg.git
Documentation: pkg.go.dev
# Functions
CheckErr panic if err is not nil.
CheckToken 验证token.
Exists 判断所给路径文件/文件夹是否存在.
GenerateToken 生成Token.
GenShortID 生成一个id.
GenUUID 生成随机字符串,eg: 76d27e8c-a80e-48c8-ad20-e5562e0f67e4.
Get send a get request with timeout.
GetBodyByte 获取io流的字节数据.
GetBodyMap 获取io流中的数据,并转成map形式.
GetBodyString 获取io流中的数据并转成string形式.
GetBodyStruct 获取io流中的数据,并转成指定的类型.
GetHostname 获取本机的hostname.
GetJSONPathData 获取jsonpath对应的字符.
GetLocalIP 获取本地内网IP.
GetWithAuth send a get request with timeout.
GetWithHeader send a get request with header and timeout.
GetWithHeaderAndAuth send a get request with header and timeout.
InitJWTUtil init the jwt key.
Interface2Struct convert the json object to struct.
IsDir 判断所给路径是否为文件夹.
IsFile 判断所给路径是否为文件.
JSON2String convert the json object to string.
PostJSON post a json data request with timeout.
PostJSONWithHeader post a json data request with timeout.
PostJSONWithHeaderAndAuth post a json data request with timeout.
PostParams post a form request with timeout.
PostParamsWithHeader post a form request with timeout.
PostParamsWithHeaderAndAuth post a form request with timeout.
Sha256Encode sha256 加密.
StringToStruct convert the string to struct.
# Constants
No description provided by the author
# Structs
HTTPAuth http auth struct.
RespJSON the common json.
ResponseWrapper the wrapper of the http response.