Documentation
¶
Index ¶
- Constants
- func Date(layout string, t time.Time) string
- func DeleteFile(fileName string) error
- func DoubleMd5Encrypt(data string) string
- func Empty(data interface{}) bool
- func Explode(separator string, str string) map[interface{}]interface{}
- func FloatScale(f float64, scale, roundMode int) float64
- func GetFile(path string) os.FileInfo
- func GetFileSize(infoPath string) int64
- func GetStructKey(data map[string]interface{}) string
- func GetTime() string
- func HttpGet(url string) ([]byte, error)
- func HttpPost() error
- func HttpsGet(url string) ([]byte, error)
- func InArray(array interface{}, value interface{}) bool
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsFile(path string) bool
- func IsWritable(path string) bool
- func JsonDecode(str string, data interface{}) error
- func JsonEncode(data interface{}) string
- func Md5(str string) string
- func RandomCreateBytes(n int, alphabets ...byte) []byte
- func Sha256Encrypt(key string) string
- func SizeFormat(size float64) string
- func Sort(key string, maps []map[string]interface{}) []map[string]interface{}
- func StrToTime(str string) (*time.Time, error)
- func ToString(data interface{}) string
- type MapsSort
- type RedisCache
- type RedisCacher
- type TempInfo
Constants ¶
View Source
const ( ROUNDING_MODE_FLOOR = 0 ROUNDING_MODE_ROUND = 1 ROUNDING_MODE_CELL = 2 )
View Source
const ( Year = "06" LongYear = "2006" Month = "Jan" ZeroMonth = "01" NumMonth = "1" LongMonth = "January" Day = "2" ZeroDay = "02" UnderDay = "_2" WeekDay = "Mon" LongWeekDay = "Monday" Hour = "15" ZeroHour12 = "03" Hour12 = "3" Minute = "4" ZeroMinute = "04" Second = "5" ZeroSecond = "05" )
View Source
const ( CHINESE_DATE_LONG_FORMAT = "2006-01-02 15:04:05" CHINESE_DATE_SHOT_FORMAT = "2006-01-01 15:04:05" )
自定义
Variables ¶
This section is empty.
Functions ¶
func Explode ¶
*
- separator 必需。规定在哪里分割字符串。
- str 必需。要分割的字符串。
- limit 可选。规定所返回的数组元素的数目。 可能的值:
- 大于 0 - 返回包含最多 limit 个元素的数组
- 小于 0 - 返回包含除了最后的 -limit 个元素以外的所有元素的数组
- 0 - 返回包含一个元素的数组
func FloatScale ¶
func GetStructKey ¶
func InArray ¶
func InArray(array interface{}, value interface{}) bool
判断数据是否在一个数组中 dataType 是value的数据类型 如果value和array切片(或数组)中值的类型不同则函数会返回false
func JsonDecode ¶
@param str json字符串 @param data 解析的数据结构 传入data的引用
func JsonEncode ¶
func JsonEncode(data interface{}) string
func RandomCreateBytes ¶
RandomCreateBytes generate random []byte by specify chars.
func SizeFormat ¶
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Close ¶
func (rc *RedisCache) Close() error
func (*RedisCache) GetGlobalCache ¶
func (rc *RedisCache) GetGlobalCache(key string) (string, error)
func (*RedisCache) SetGlobalCache ¶
func (rc *RedisCache) SetGlobalCache(key string, value interface{}, expiration time.Duration) error
type RedisCacher ¶
Click to show internal directories.
Click to hide internal directories.