Documentation ¶
Index ¶
- Constants
- func ArrayColumn(array interface{}, columnKey string) ([]interface{}, error)
- func ArrayStringColumn(array interface{}, columnKey string) ([]string, error)
- 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 GetKindOfData(data interface{}) string
- func GetSliceColumnMapArray(data interface{}, columnKey string) (map[string]interface{}, error)
- func GetStructColumnValueByColumnKey(data interface{}, columnKey string) interface{}
- func GetStructKey(data map[string]interface{}) string
- func GetTime() string
- func GroupingMapDataByColumnKeyValue(data interface{}, columnKey string) (map[string][]interface{}, error)
- 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 ArrayColumn ¶ added in v1.0.6
获取数组中某个字段的值的构成的数组指针
func ArrayStringColumn ¶ added in v1.0.6
获取数组中某个字段的值(string 类型)的构成的数组指针
func Date ¶ added in v1.0.4
*
- 将time.Time类型按字符串Y-m-d H:i:s格式格式化
- t 要格式化的时间
- layout 要格式化的时间格式 Y-m-d H:i:s、 Y-m-d等等
func DoubleMd5Encrypt ¶ added in v1.0.4
Double Md5 Encrypt
func Explode ¶ added in v1.0.4
*
- separator 必需。规定在哪里分割字符串。
- str 必需。要分割的字符串。
- limit 可选。规定所返回的数组元素的数目。 可能的值:
- 大于 0 - 返回包含最多 limit 个元素的数组
- 小于 0 - 返回包含除了最后的 -limit 个元素以外的所有元素的数组
- 0 - 返回包含一个元素的数组
func FloatScale ¶ added in v1.0.4
func GetKindOfData ¶ added in v1.0.6
func GetKindOfData(data interface{}) string
func GetSliceColumnMapArray ¶ added in v1.0.6
map数组中的值根据需要使用类型断言转换 columnKey需是唯一值不重复
func GetStructColumnValueByColumnKey ¶ added in v1.0.6
func GetStructColumnValueByColumnKey(data interface{}, columnKey string) interface{}
Get Struct column value by (struct column) key data should be a Struct or a (Struct) Ptr
func GetStructKey ¶ added in v1.0.4
func GroupingMapDataByColumnKeyValue ¶ added in v1.0.6
func GroupingMapDataByColumnKeyValue(data interface{}, columnKey string) (map[string][]interface{}, error)
根据数组中某个字段的值分组 返回的是多个数组映射
func InArray ¶ added in v1.0.4
func InArray(array interface{}, value interface{}) bool
判断数据是否在一个数组中 dataType 是value的数据类型 如果value和array切片(或数组)中值的类型不同则函数会返回false
func JsonDecode ¶ added in v1.0.4
@param str json字符串 @param data 解析的数据结构 传入data的引用
func JsonEncode ¶ added in v1.0.4
func JsonEncode(data interface{}) string
func RandomCreateBytes ¶ added in v1.0.4
RandomCreateBytes generate random []byte by specify chars.
func SizeFormat ¶ added in v1.0.4
Types ¶
type RedisCache ¶ added in v1.0.4
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Close ¶ added in v1.0.4
func (rc *RedisCache) Close() error
func (*RedisCache) GetGlobalCache ¶ added in v1.0.4
func (rc *RedisCache) GetGlobalCache(key string) (string, error)
func (*RedisCache) SetGlobalCache ¶ added in v1.0.4
func (rc *RedisCache) SetGlobalCache(key string, value interface{}, expiration time.Duration) error
type RedisCacher ¶ added in v1.0.4
type RedisCacher interface { SetGlobalCache(key string, value interface{}, expiration time.Duration) error GetGlobalCache(key string) (string, error) Close() error }
func NewRedisCacher ¶ added in v1.0.4
func NewRedisCacher(Options *redis.Options) (RedisCacher, error)
生成redis缓存操作接口
type TempInfo ¶ added in v1.0.4
type TempInfo struct { ChunkSize int64 `json:"ChunkSize"` FileHash string `json:"FileHash"` FileId string `json:"FileId"` FileName string `json:"FileName"` FileSize int64 `json:"FileSize"` Label string `json:"Label"` }
func GetJsonFileInfo ¶ added in v1.0.4
获取文件中的json数据
Click to show internal directories.
Click to hide internal directories.