Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(data []byte, key []byte) ([]byte, error)
- func AesEncrypt(data []byte, key []byte) ([]byte, error)
- func BigFileMd5(path string) (string, error)
- func BinaryFind(arrslice []int64, findvalue int64) int
- func BubbleSortPro(arr []int64) []int64
- func BuildURL(prefix string, params ...interface{}) (urlstr string)
- func CalcInt(num1 interface{}, oper string, num2 interface{}) int
- func CheckFileIsExist(filename string) bool
- func CheckFileName(fileName string) error
- func CheckFileType(allSupportedType []string, fileName string) error
- func CheckInterface(inter interface{})
- func CheckName(fileName string) error
- func CompressSvg(file string) (err error)
- func ComputeFileMD5(file io.Reader) string
- func ConvertToYuan(amount float64, unit string, decimalPlaces int) (float64, string)
- func CreateCaptcha(n int) string
- func DataString2Time(str string, format ...string) time.Time
- func Decimal(value float64) float64
- func DecodeURI(encoded string) (string, error)
- func DecryptByAes(data string, key []byte) ([]byte, error)
- func DeleteSlice(slice []string, keys ...string) []string
- func DetermineUnit(amount float64) string
- func EncUserPwd(password, salt string) (hash string)
- func EncodeURI(rawString string) string
- func EncryptByAes(data []byte, key []byte) (string, error)
- func Equal(itf1, itf2 interface{}) bool
- func FileMd5(path string) (string, error)
- func FirstMonday(year int, month time.Month) int
- func GenerateGUID() string
- func GenerateInt64() int64
- func GenerateSalt() (salt string)
- func GenerateUUID() string
- func GetDays(start, end int64) (timeSilce []string)
- func GetDuration(start, end int64) int
- func GetFileExt(fileName string) string
- func GetFirstDateOfWeek() (weekMonday string)
- func GetHourDiffer(start_time, end_time string) int64
- func GetLastWeekFirstDate() (weekMonday string)
- func GetNextWeekFirstDate() (weekMonday string)
- func GetNextWeekLastDate() (weekMonday string)
- func GetSuffix(str, seg string) string
- func HeightLight(title string, words []string) template.HTML
- func HtmlToMarkdown(html string) (string, error)
- func HttpPost(url, token string, parMap interface{}) (map[string]interface{}, error)
- func Int2Int64(a int) int64
- func Int2String(a int) string
- func Int642String(a int64) string
- func Interface2Int(a interface{}) int
- func Interface2Int64(a interface{}) int64
- func Interface2String(v interface{}) string
- func IsChinese(str string) bool
- func IsImage(path string) bool
- func LocalTransUTC(localTime string) string
- func MyMD5(str string) string
- func NumberOfNowWeekInMonth() int
- func NumberOfWeekInMonth(t time.Time) int
- func NumberRange(val, min, max int) int
- func RemoveDuplicateElement(addrs []string) []string
- func RemoveDuplicateIntElement(addrs []int) []int
- func RemoveDuplicateUintElement(addrs []uint) []uint
- func RemoveRepeatedElement(tags string) (newtags string)
- func Sha1Enc(s string) string
- func StarVal(score int, IsScore bool) string
- func String2Int(a string) int
- func String2Int64(a string) int64
- func String2Time(str string, format ...string) time.Time
- func StringIn(target string, str_array []string) bool
- func StringListToIntList(src []string) (dest []int)
- func StringSliceToInterfaceSlice(slice []string) (ret []interface{})
- func StringSliceToMap(slice []string) (maps map[string]string)
- func Struct2Map(obj interface{}) map[string]interface{}
- func Strval(value interface{}) interface{}
- func Strval2String(value interface{}) string
- func SubStr(str interface{}, start, length int) string
- func TimestampFormat(timestamp int64, format ...string) string
- func ToBytes(size int64, unit string) int64
- func ToInterfaceSlice(slice interface{}) []interface{}
- func TwoDifference(slice1, slice2 []int) []int
- func TwoIntersect(slice1, slice2 []int) []int
- func TwoUnion(slice1, slice2 []int) []int
- func UTCTransLocal(utcTime string) string
- func Uint2String(a uint) string
- func Uint642String(a uint64) string
- func UndifinedTimeToStr(t1 string) time.Time
- func UniqueSort(slice []int64) []int64
- func Unzip(zipFile string, destDir string) error
- func UpperFirst(str string) string
- func UrlEscape(str string) string
- func UserMD5(usr string, pwd string, salt string) string
- func WhichWeekDay() int
- func Xmd5(md5str interface{}) string
- func Zip(srcFile string, destZip string) error
- type EscapeError
- type Headers
- type Info
- type ServiceClient
- func (o *ServiceClient) Delete(url string, v ...interface{}) *req.Resp
- func (o *ServiceClient) Get(url string, v ...interface{}) *req.Resp
- func (o *ServiceClient) Head(url string, v ...interface{}) *req.Resp
- func (o *ServiceClient) Post(url string, v ...interface{}) *req.Resp
- func (o *ServiceClient) Put(url string, v ...interface{}) *req.Resp
Constants ¶
View Source
const ( KB int64 = 1 << (10 * iota) MB GB TB )
将KB、MB、GB和TB转换为字节的
Variables ¶
View Source
var PwdKey = []byte("1234asdf1234asdf")
16,24,32位字符串的话,分别对应AES-128,AES-192,AES-256 加密方法 key不能泄露
Functions ¶
func BigFileMd5 ¶
func BinaryFind ¶
func BubbleSortPro ¶
func CheckFileIsExist ¶
func CheckFileType ¶
CheckFileType ***
func CheckInterface ¶
func CheckInterface(inter interface{})
func ComputeFileMD5 ¶
func ConvertToYuan ¶
ConvertToYuan 将金额转换为匹配的单位
func DecryptByAes ¶
DecryptByAes base64解码后 Aes 解密
func EncryptByAes ¶
EncryptByAes Aes加密 后 base64
func GenerateInt64 ¶ added in v1.2.7
func GenerateInt64() int64
func GenerateUUID ¶
func GenerateUUID() string
func GetDuration ¶
func GetFileExt ¶
func GetFirstDateOfWeek ¶
func GetFirstDateOfWeek() (weekMonday string)
func GetHourDiffer ¶
func GetNextWeekFirstDate ¶
func GetNextWeekFirstDate() (weekMonday string)
func GetNextWeekLastDate ¶
func GetNextWeekLastDate() (weekMonday string)
func HtmlToMarkdown ¶
func Int2String ¶
func Int642String ¶
func Interface2Int ¶
func Interface2Int(a interface{}) int
将字符串或者其他可转化数字的内容格式化成int数字类型返回
a interface{} 需要转化成数字的内容
func Interface2Int64 ¶
func Interface2Int64(a interface{}) int64
func Interface2String ¶
func Interface2String(v interface{}) string
将interface{}转为字符串,适合bool,数字等 @v interface{} 需要转化为字符串的值
func LocalTransUTC ¶
func RemoveDuplicateElement ¶
func RemoveRepeatedElement ¶
func String2Int ¶
func String2Int64 ¶
func String2Time ¶
字符串转时间格式 @str string 时间字符串 @format string 时间格式,如:"2006-01-02 15:04:05"
func StringListToIntList ¶
func StringSliceToInterfaceSlice ¶
func StringSliceToInterfaceSlice(slice []string) (ret []interface{})
将字符串切片转成interface切片
func StringSliceToMap ¶
将字符串切片数组转成map
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
func Strval2String ¶
func Strval2String(value interface{}) string
func TimestampFormat ¶
时间戳格式化 @timestamp int 时间戳 @format string 时间格式,如:"2006-01-02 15:04:05"
func ToInterfaceSlice ¶
func ToInterfaceSlice(slice interface{}) []interface{}
func UTCTransLocal ¶
func Uint2String ¶
func Uint642String ¶
func UndifinedTimeToStr ¶
func UniqueSort ¶
Types ¶
type EscapeError ¶
type EscapeError string
EscapeError ***
func (EscapeError) Error ¶
func (e EscapeError) Error() string
type Headers ¶
Headers ***
func (*Headers) AddBasicAuthHeader ¶
AddBasicAuthHeader ***
func (*Headers) AddOAuth2Header ¶
AddOAuth2Header ***
type Info ¶
type Info struct {
Width, Height int //图片宽高
Size int64 //图片文件大小
Md5 string //图片md5
ModTime int //图片修改时间戳
Ext string //图片后缀
}
图片文件信息
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
ServiceClient ***
func (*ServiceClient) Delete ¶
func (o *ServiceClient) Delete(url string, v ...interface{}) *req.Resp
Delete ***
func (*ServiceClient) Get ¶
func (o *ServiceClient) Get(url string, v ...interface{}) *req.Resp
Get ***
func (*ServiceClient) Head ¶
func (o *ServiceClient) Head(url string, v ...interface{}) *req.Resp
Head ***
Click to show internal directories.
Click to hide internal directories.