Documentation ¶
Index ¶
- Variables
- func AESDecryptData(keystr, hexSrc string) string
- func AESEncryptData(keystr, src string) string
- func Bool(i bool) *bool
- func BoolToByte(b bool) byte
- func Byte(i byte) *byte
- func ByteToBool(b byte) bool
- func Float64(i float64) *float64
- func FormatNumberToShortString(number int64) string
- func FromGzip(data []byte) (bs []byte, err error)
- func FromGzipToJSON(data []byte, obj interface{}) (err error)
- func GenRandomString(n int, randomRange []string) string
- func GetCurrMilliTs() int64
- func GetLocalTime() *time.Time
- func GetNextDayZeroTs() int64
- func GetTimeByTs(ts int64) time.Time
- func GetUTCTime() *time.Time
- func GetZeroTime() time.Time
- func GetZeroTimeOf(t time.Time) time.Time
- func HmacSha1(message, secret string) string
- func Int32(i int32) *int32
- func Int64(i int64) *int64
- func IsEmpty(val interface{}) bool
- func IsInArray(arr []string, val string) bool
- func IsNumber(s string) bool
- func JSONStringToMap(jsonStr string) (map[string]interface{}, error)
- func MD5String(b []byte) string
- func ParseQueries(url string) map[string]string
- func QueryEscape(s string) string
- func QueryUnescape(s string) (string, error)
- func RandString(l int) string
- func SleepRandomTime(maxSleepTime time.Duration)
- func String(s string) *string
- func StringToFloat64(str string) (value float64)
- func StringToInt32(val string) (value int32)
- func StringToInt64(val string) (value int64)
- func Time(t time.Time) *time.Time
- func TimeAgoInWords(ts int64) string
- func TimeFormat(layout string, dateTime time.Time) string
- func ToGzip(bs []byte) (gziped bool, data []byte, err error)
- func ToGzipJSON(obj interface{}) (gziped bool, data []byte, err error)
- func ToJSONString(data interface{}) string
- func ToPercent(f float64) string
- func ToTime(layout, value string) *time.Time
- func TsToCn(ts int32) string
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// GZipMinSize 要启用gzip的最小值
GZipMinSize = 1024
)
Functions ¶
func AESDecryptData ¶
AESDecryptData AESDecryptData
func FormatNumberToShortString ¶
FormatNumberToShortString 数字格式化为短字符串,如 10000 = 1万
func FromGzipToJSON ¶
FromGzipToJSON from gzip json
func GenRandomString ¶
GenRandomString 生成随机字符串
func JSONStringToMap ¶
JSONStringToMap json string to map
func ParseQueries ¶
func QueryEscape ¶
func QueryUnescape ¶
func StringToFloat64 ¶
func StringToInt32 ¶
func StringToInt64 ¶
func TimeFormat ¶
TimeFormat 日期格式化: yyyy-MM-dd HH:mm:ss
func ToGzipJSON ¶
ToGzipJSON 转换成json并gzip
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.