Documentation ¶
Index ¶
- func GetJson(ctx iris.Context, target interface{}) error
- func GetValidatedJson(ctx iris.Context, target interface{}) error
- func ReturnError(ctx iris.Context, msg string)
- func ReturnResult(ctx iris.Context, message string, data interface{}, statusCode int)
- type CryptorHelper
- type LbsHelper
- type MapHelper
- func (*MapHelper) Equal(m1, m2 map[string]interface{}) bool
- func (*MapHelper) Exist(data map[string]interface{}, key string) bool
- func (*MapHelper) Filter(target map[string]interface{}, fields []string)
- func (*MapHelper) GetFloat64Keys(imap map[string]interface{}) []float64
- func (*MapHelper) GetInt64Keys(imap map[string]interface{}) []int64
- func (*MapHelper) GetIntKeys(imap map[string]interface{}) []int
- func (*MapHelper) GetIntKeysFromIntKeyMap(imap map[int]bool) []int
- func (*MapHelper) GetKeys(imap map[string]interface{}) []string
- func (*MapHelper) GetKeysPlus(imap map[string]map[string]interface{}) []string
- func (*MapHelper) GetValues(imap map[string]interface{}) []interface{}
- func (*MapHelper) HasIllegalKey(target map[string]interface{}, fields []string) bool
- type MathHelper
- func (mathHelper *MathHelper) GetBezierPoints(dots []map[string]float64, amount int) []map[string]float64
- func (mathHelper *MathHelper) GetInsideDots(dots1 map[float64]map[string]float64, dots2 map[float64]map[string]float64) []map[string]float64
- func (*MathHelper) GetIntergers(border1 float64, border2 float64, narrow_range float64, amount float64) []float64
- func (*MathHelper) GetNearestIntXDots(dots []map[string]float64) map[float64]map[string]float64
- func (*MathHelper) GetRandomFloat64() (num float64)
- func (*MathHelper) GetRandomInt(min, max int) (num int)
- func (*MathHelper) Keep(number float64, amount int) float64
- func (*MathHelper) MatrixTransform(data []float64, matrix [][]float64) []float64
- type Method
- type NetworkHelper
- func (networkHelper *NetworkHelper) DownloadFile(targetURL, localPath string) (fileName, pathString string, err error)
- func (*NetworkHelper) DownloadFileWithFormat(targetURL, localPath, format string, headers map[string]string) (fileName, tempPath string, header *http.Header, err error)
- func (networkHelper *NetworkHelper) GetParsedURL(apiURL string, params map[string]interface{}) (string, error)
- func (networkHelper *NetworkHelper) GetRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
- func (*NetworkHelper) ParamsInvalid(ctx iris.Context, err error)
- func (*NetworkHelper) PostJsonRequest(apiURL string, params map[string]interface{}) ([]byte, error)
- func (networkHelper *NetworkHelper) PostRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
- func (*NetworkHelper) RequestJson(method Method, targetURL string, params map[string]interface{}, ...) (map[string]interface{}, *http.Header, int, error)
- func (*NetworkHelper) RequestJsonTest(method Method, targetURL string, params map[string]interface{}, ...) (map[string]interface{}, *http.Header, int, error)
- func (*NetworkHelper) RequestRaw(method Method, targetURL string, params map[string]interface{}, ...) (string, *http.Header, int, error)
- func (*NetworkHelper) RequestRawTest(method Method, targetURL string, params map[string]interface{}, ...) (string, *http.Header, int, error)
- type OsHelper
- type Set
- type SliceHelper
- func (*SliceHelper) ArrayFilter(a []interface{}) (ret []interface{})
- func (*SliceHelper) ArrayGroupByMapKey(key string, list []map[string]interface{}) [][]map[string]interface{}
- func (*SliceHelper) Diffrence(arr_1 []int64, arr_2 []int64) []int64
- func (*SliceHelper) DiffrenceFloat64(arr_1 []float64, arr_2 []float64) []float64
- func (*SliceHelper) Exist(needle interface{}, hystack_array interface{}) bool
- func (*SliceHelper) ExistInt(needle int, hystackArray []int) bool
- func (*SliceHelper) Float64SliceDelete(slice []float64, index int) []float64
- func (*SliceHelper) Float64SliceSum(arr []float64) float64
- func (*SliceHelper) GetFloat64FromInt64MapSlice(d []map[string]interface{}, column_key string) []float64
- func (*SliceHelper) GetFloat64FromInterfaceSlice(d []interface{}, column_key string) []float64
- func (*SliceHelper) GetFloat64FromMapSlice(d []map[string]interface{}, column_key string) []float64
- func (*SliceHelper) GetInt64FromInterfaceSlice(d []interface{}, column_key string) []int64
- func (*SliceHelper) GetInt64FromMapSlice(d []map[string]interface{}, column_key string) []int64
- func (*SliceHelper) GetIntFromInterfaceSlice(d []interface{}, column_key string) []int
- func (*SliceHelper) GetIntFromMapSlice(d []map[string]interface{}, column_key string) []int
- func (*SliceHelper) GetIntFromMapSliceByInt64(d []map[string]interface{}, column_key string) []int
- func (sliceHelper *SliceHelper) GetParentIds(children_id, result_str, key string, original_data []map[string]interface{}) string
- func (*SliceHelper) GetRange(min float64, max float64, step float64) []float64
- func (*SliceHelper) GetValuesFromInterfaceSlice(d []interface{}, column_key string) []interface{}
- func (*SliceHelper) GetValuesFromMapSlice(d []map[string]interface{}, column_key string) []interface{}
- func (*SliceHelper) IndexOf(needle interface{}, hystack_array interface{}) int
- func (*SliceHelper) IndexOfStrSlice(needle string, fields_slice []string) int
- func (*SliceHelper) Int64Slice2Float64Slice(data []int64) []float64
- func (*SliceHelper) Int64SliceDelete(slice []int64, index int) []int64
- func (*SliceHelper) IntSliceDelete(slice []int, index int) []int
- func (*SliceHelper) InterfaceSlice2SimpleMap(data []interface{}, index, key string) map[string]interface{}
- func (*SliceHelper) InterfaceSliceSum(arr []interface{}) float64
- func (*SliceHelper) Intersect(arr_1 []interface{}, arr_2 []interface{}) []interface{}
- func (*SliceHelper) IntersectFloat64(arr_1 []float64, arr_2 []float64) []float64
- func (*SliceHelper) IntersectInt(arr_1 []int64, arr_2 []int64) []int64
- func (*SliceHelper) Join(islice []string, letter string) string
- func (*SliceHelper) JoinInterfaceSlice(islice []interface{}, letter string) string
- func (*SliceHelper) MapSlice2SimpleMap(data []map[string]interface{}, index, key string) map[string]interface{}
- func (*SliceHelper) MapSliceDelete(slice []map[string]interface{}, index int) []map[string]interface{}
- func (*SliceHelper) MapSliceReverse(arr []map[string]interface{}) ([]map[string]interface{}, error)
- func (*SliceHelper) Merge(arr_1 []map[string]float64, arr_2 []map[string]float64) []map[string]float64
- func (*SliceHelper) NarrowSlice(arr []map[string]interface{}, amount int) []map[string]interface{}
- func (*SliceHelper) Paginator(page, pageSize int, data []map[string]interface{}) []map[string]interface{}
- func (*SliceHelper) Slice2MapByInt64ColumnAsKey(data []map[string]interface{}, index string) map[string]interface{}
- func (*SliceHelper) SliceDelete(slice []interface{}, index int) []interface{}
- func (*SliceHelper) StrSliceDelete(slice []string, index int) []string
- func (*SliceHelper) UniqueByLoop(slc []int) []int
- func (*SliceHelper) UniqueByMap(slc []int) []int
- func (sliceHelper *SliceHelper) UniqueIntSlice(slc []int) []int
- func (*SliceHelper) UniqueInterface(slc []interface{}) []interface{}
- func (*SliceHelper) UniqueStrSlice(strSlice []string) []string
- type Snowflake
- type StrHelper
- func (*StrHelper) Base64Decode(str string) (data []byte)
- func (*StrHelper) Base64Encode(src []byte) (str string)
- func (*StrHelper) GetRandomString(l int) string
- func (*StrHelper) GetWordsLength(str string) float64
- func (*StrHelper) StripTags(body string) string
- func (*StrHelper) Substr(s string, start, length int) string
- func (*StrHelper) Trim(str string) (data string)
- func (*StrHelper) ValidatePhone(phoneNum string) bool
- type StructHelper
- type TimeHelper
- func (*TimeHelper) BeautyTimeStamp(timeStamp, currentTime int64) string
- func (*TimeHelper) FromTodayToTomorrowTimeStamp() (today, tomorrow int64)
- func (*TimeHelper) GetISO8601(date int64) string
- func (*TimeHelper) GetZeroTimeStamp(d time.Time) time.Time
- func (timeHelper *TimeHelper) LastDayOfTimeStamp(d time.Time) int64
- type TypeHelper
- func (*TypeHelper) Bytes2Int(b []byte) int
- func (typeHelper *TypeHelper) Empty(arg interface{}) bool
- func (*TypeHelper) Explode(data string, sep string) []interface{}
- func (*TypeHelper) ExplodeFloat64(data string, sep string) []float64
- func (*TypeHelper) ExplodeInt(data string, sep string) []int
- func (*TypeHelper) ExplodeInt64(data string, sep string) []int64
- func (*TypeHelper) Float64Slice2IntSlice(slice []interface{}) []int
- func (*TypeHelper) Float64ToStr(number float64) string
- func (*TypeHelper) GetType(params interface{}) string
- func (*TypeHelper) If(conditions bool, trueVal, falseVal interface{}) interface{}
- func (typeHelper *TypeHelper) Implode(data interface{}, glue string) string
- func (*TypeHelper) Int2Bytes(n int) []byte
- func (*TypeHelper) Int2Str(number int) string
- func (*TypeHelper) Int64Slice2IntSlice(int64_slice []int64) []int
- func (*TypeHelper) Int64ToStr(number int64) string
- func (*TypeHelper) InterfaceSlice2MapSlice(inter []interface{}) []map[string]interface{}
- func (*TypeHelper) IsNil(i interface{}) bool
- func (*TypeHelper) IsType(needle interface{}, type_name string) bool
- func (*TypeHelper) JsonDecode(json_str string) map[string]interface{}
- func (*TypeHelper) JsonDecodeInt64Slice(json_str string) []int64
- func (*TypeHelper) JsonDecodeWithStruct(json_str string, istruct interface{}) interface{}
- func (*TypeHelper) JsonEncode(data interface{}) (string, error)
- func (*TypeHelper) Map2InterfaceSlice(data map[string]interface{}) []interface{}
- func (*TypeHelper) Str2Float64(str string) float64
- func (*TypeHelper) Str2Int(str string) int
- func (*TypeHelper) Str2Int64(str string) int64
- func (*TypeHelper) Str2Int8(str string) int8
- func (*TypeHelper) StrSlice2InterfaceSlice(data []string) []interface{}
- func (*TypeHelper) ToString(data interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJson ¶ added in v0.5.2
func GetJson(ctx iris.Context, target interface{}) error
GetJson 获取body体中的json数据
func GetValidatedJson ¶ added in v0.5.2
func GetValidatedJson(ctx iris.Context, target interface{}) error
GetValidatedJson 获取通过validatMng验证过的json数据
func ReturnError ¶ added in v0.4.4
func ReturnError(ctx iris.Context, msg string)
*
- @func: ReturnResult json格式返回
- @author Wiidz
- @date 2019-11-16
func ReturnResult ¶ added in v0.2.5
Types ¶
type CryptorHelper ¶ added in v0.3.9
type CryptorHelper struct{}
func (*CryptorHelper) MD5Encrypt ¶ added in v0.3.9
func (*CryptorHelper) MD5Encrypt(raw string) string
type MapHelper ¶
type MapHelper struct{}
func (*MapHelper) GetFloat64Keys ¶
*
- @func: GetKeys 从 map[string]interface{} 中获取float64类型的键名
- @author Wiidz
- @date 2019-11-16
func (*MapHelper) GetInt64Keys ¶
*
- @func: GetKeys 从 map[string]interface{} 中获取int64类型的键名
- @author Wiidz
- @date 2019-11-16
func (*MapHelper) GetIntKeys ¶
*
- @func: GetKeys 从 map[string]interface{} 中获取整数类型的键名
- @author Wiidz
- @date 2019-11-16
func (*MapHelper) GetIntKeysFromIntKeyMap ¶
*
- @func: GetKeys 从 map[string]interface{} 中获取整数类型的键名
- @author Wiidz
- @date 2019-11-16
func (*MapHelper) GetKeys ¶
*
- @func: GetKeys 从 map[string]interface{} 中获取键名
- @author Wiidz
- @date 2019-11-16
func (*MapHelper) GetKeysPlus ¶
*
- @func: GetKeysPlus 从 map[string]map[string]interface{} 中获取一级键名
- @author Wiidz
- @date 2019-11-16
type MathHelper ¶
type MathHelper struct{}
func (*MathHelper) GetBezierPoints ¶
func (mathHelper *MathHelper) GetBezierPoints(dots []map[string]float64, amount int) []map[string]float64
*
- @func: GetBezierPoints 获取贝塞尔曲线上的所有规定数量的点
- @author Wiidz
- @date 2019-11-16
func (*MathHelper) GetInsideDots ¶
func (mathHelper *MathHelper) GetInsideDots(dots1 map[float64]map[string]float64, dots2 map[float64]map[string]float64) []map[string]float64
*
- @func: GetInsideDots 获取两组点构成的线,包围区域中间的点
- @author Wiidz
- @date 2019-11-16
func (*MathHelper) GetIntergers ¶
func (*MathHelper) GetIntergers(border1 float64, border2 float64, narrow_range float64, amount float64) []float64
*
- @func: GetIntergers 获取两个数之间指定数量的等分点
- @author Wiidz
- @date 2019-11-16
func (*MathHelper) GetNearestIntXDots ¶
*
- @func: GetNearestIntXDots 获取一组点中最接近整数x的点
- @author Wiidz
- @date 2019-11-16
func (*MathHelper) GetRandomFloat64 ¶ added in v0.1.4
func (*MathHelper) GetRandomFloat64() (num float64)
*
- @func: GetRandomInt 获取范围内的int随机数
- @author Wiidz
- @date 2021-06-19
func (*MathHelper) GetRandomInt ¶
func (*MathHelper) GetRandomInt(min, max int) (num int)
*
- @func: GetRandomInt 获取范围内的int随机数
- @author Wiidz
- @date 2019-11-16
func (*MathHelper) MatrixTransform ¶
func (*MathHelper) MatrixTransform(data []float64, matrix [][]float64) []float64
*
- @func: MatrixTransform 矩阵变换
- @author Wiidz
- @date 2019-11-16
type NetworkHelper ¶
type NetworkHelper struct{}
func (*NetworkHelper) DownloadFile ¶
func (networkHelper *NetworkHelper) DownloadFile(targetURL, localPath string) (fileName, pathString string, err error)
*
- @func: DownloadFile 下载目标文件到本地
- @author: Wiidz
- @date: 2021-6-20
func (*NetworkHelper) DownloadFileWithFormat ¶ added in v0.2.3
func (*NetworkHelper) DownloadFileWithFormat(targetURL, localPath, format string, headers map[string]string) (fileName, tempPath string, header *http.Header, err error)
*
- @func: DownloadFileWithFormat 下载目标文件到本地,强制命名格式
- @author: Wiidz
- @date: 2021-6-20
func (*NetworkHelper) GetParsedURL ¶ added in v0.3.1
func (networkHelper *NetworkHelper) GetParsedURL(apiURL string, params map[string]interface{}) (string, error)
*
- @func: GetParsedURL 获取get地址
- @author: Wiidz
- @date: 2021-06-20
func (*NetworkHelper) GetRequest ¶
func (networkHelper *NetworkHelper) GetRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
*
- @func: GetRequest 发送get请求
- @author: Wiidz
- @date: 2021-06-20
func (*NetworkHelper) ParamsInvalid ¶ added in v0.5.2
func (*NetworkHelper) ParamsInvalid(ctx iris.Context, err error)
*
- @func: ReturnResult json格式返回
- @author Wiidz
- @date 2019-11-16
func (*NetworkHelper) PostJsonRequest ¶ added in v0.3.0
func (*NetworkHelper) PostJsonRequest(apiURL string, params map[string]interface{}) ([]byte, error)
*
- @func: PostRequest 发送post请求
- @author Wiidz
- @date 2019-11-16
func (*NetworkHelper) PostRequest ¶
func (networkHelper *NetworkHelper) PostRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
*
- @func: PostRequest 发送post请求
- @author: Wiidz
- @date: 2021-6-20
func (*NetworkHelper) RequestJson ¶ added in v0.5.2
func (*NetworkHelper) RequestJsonTest ¶ added in v0.5.2
func (*NetworkHelper) RequestRaw ¶ added in v0.5.2
type OsHelper ¶
type OsHelper struct{}
func (*OsHelper) DownloadFile ¶
func (osHelper *OsHelper) DownloadFile(url string, localPath string, fb func(length, downLen int64)) error
*
- @func: DownloadFile 从url中下载文件
- @author Wiidz
- @date 2019-11-16
func (*OsHelper) GetFileBuf ¶
type SliceHelper ¶
type SliceHelper struct{}
func (*SliceHelper) ArrayFilter ¶
func (*SliceHelper) ArrayFilter(a []interface{}) (ret []interface{})
*
- @func: ArrayFilter 不知道
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) ArrayGroupByMapKey ¶
func (*SliceHelper) ArrayGroupByMapKey(key string, list []map[string]interface{}) [][]map[string]interface{}
*
- @func: ArrayGroupByMapKey 以一个数组map 中的某一个key 进行分组
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) Diffrence ¶
func (*SliceHelper) Diffrence(arr_1 []int64, arr_2 []int64) []int64
*
- @func: ArrayIntersect 取出两个slice的差集
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) DiffrenceFloat64 ¶
func (*SliceHelper) DiffrenceFloat64(arr_1 []float64, arr_2 []float64) []float64
*
- @func: ArrayIntersect 取出两个slice的差集
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) Exist ¶
func (*SliceHelper) Exist(needle interface{}, hystack_array interface{}) bool
*
- @func: Exsit 判断slice中是否存在needle
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) ExistInt ¶ added in v0.1.9
func (*SliceHelper) ExistInt(needle int, hystackArray []int) bool
*
- @func: Exsit 判断slice中是否存在needle
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) Float64SliceDelete ¶
func (*SliceHelper) Float64SliceDelete(slice []float64, index int) []float64
*
- @func: SliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) Float64SliceSum ¶
func (*SliceHelper) Float64SliceSum(arr []float64) float64
*
- @func: Float64SliceSum float64切片求和
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetFloat64FromInt64MapSlice ¶
func (*SliceHelper) GetFloat64FromInt64MapSlice(d []map[string]interface{}, column_key string) []float64
*
- @func: SkuList 从map slice中获取键值 int64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetFloat64FromInterfaceSlice ¶
func (*SliceHelper) GetFloat64FromInterfaceSlice(d []interface{}, column_key string) []float64
*
- @func: GetFloat64FromMapSlice 从map slice中获取键值float64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetFloat64FromMapSlice ¶
func (*SliceHelper) GetFloat64FromMapSlice(d []map[string]interface{}, column_key string) []float64
*
- @func: GetFloat64FromMapSlice 从map slice中获取键值float64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetInt64FromInterfaceSlice ¶
func (*SliceHelper) GetInt64FromInterfaceSlice(d []interface{}, column_key string) []int64
*
- @func: GetFloat64FromMapSlice 从map slice中获取键值float64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetInt64FromMapSlice ¶
func (*SliceHelper) GetInt64FromMapSlice(d []map[string]interface{}, column_key string) []int64
*
- @func: SkuList 从map slice中获取键值 int64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetIntFromInterfaceSlice ¶
func (*SliceHelper) GetIntFromInterfaceSlice(d []interface{}, column_key string) []int
*
- @func: GetFloat64FromMapSlice 从map slice中获取键值float64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetIntFromMapSlice ¶
func (*SliceHelper) GetIntFromMapSlice(d []map[string]interface{}, column_key string) []int
*
- @func: GetIntFromMapSlice 从map slice中获取键值 int slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetIntFromMapSliceByInt64 ¶
func (*SliceHelper) GetIntFromMapSliceByInt64(d []map[string]interface{}, column_key string) []int
*
- @func: SkuList 从map slice中获取键值 int64 slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetParentIds ¶
func (sliceHelper *SliceHelper) GetParentIds(children_id, result_str, key string, original_data []map[string]interface{}) string
*
- @func: GetParentIds 递归查找父级逗号隔开从高到低
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) GetRange ¶
func (*SliceHelper) GetRange(min float64, max float64, step float64) []float64
*
- @func: GetRange 类似php的函数,获取范围内的整数集合
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetValuesFromInterfaceSlice ¶
func (*SliceHelper) GetValuesFromInterfaceSlice(d []interface{}, column_key string) []interface{}
*
- @func: GetValuesFromInterface 从interface slice中获取键值slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) GetValuesFromMapSlice ¶
func (*SliceHelper) GetValuesFromMapSlice(d []map[string]interface{}, column_key string) []interface{}
*
- @func: GetValuesFromMapSlice 从map slice中获取键值slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) IndexOf ¶
func (*SliceHelper) IndexOf(needle interface{}, hystack_array interface{}) int
*
- @func: IndexOfStrSlice 从slice中,寻找指定内容的键值
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) IndexOfStrSlice ¶
func (*SliceHelper) IndexOfStrSlice(needle string, fields_slice []string) int
*
- @func: IndexOfStrSlice 从str slice中,寻找指定内容的键值
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) Int64Slice2Float64Slice ¶
func (*SliceHelper) Int64Slice2Float64Slice(data []int64) []float64
func (*SliceHelper) Int64SliceDelete ¶
func (*SliceHelper) Int64SliceDelete(slice []int64, index int) []int64
*
- @func: SliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) IntSliceDelete ¶
func (*SliceHelper) IntSliceDelete(slice []int, index int) []int
*
- @func: SliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) InterfaceSlice2SimpleMap ¶
func (*SliceHelper) InterfaceSlice2SimpleMap(data []interface{}, index, key string) map[string]interface{}
func (*SliceHelper) InterfaceSliceSum ¶
func (*SliceHelper) InterfaceSliceSum(arr []interface{}) float64
*
- @func: InterfaceSliceSum float64切片求和
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) Intersect ¶
func (*SliceHelper) Intersect(arr_1 []interface{}, arr_2 []interface{}) []interface{}
*
- @func: ArrayIntersect 取出两个slice的交集
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) IntersectFloat64 ¶
func (*SliceHelper) IntersectFloat64(arr_1 []float64, arr_2 []float64) []float64
*
- @func: ArrayIntersect 取出两个slice的交集
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) IntersectInt ¶
func (*SliceHelper) IntersectInt(arr_1 []int64, arr_2 []int64) []int64
*
- @func: ArrayIntersect 取出两个slice的交集
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) JoinInterfaceSlice ¶
func (*SliceHelper) JoinInterfaceSlice(islice []interface{}, letter string) string
func (*SliceHelper) MapSlice2SimpleMap ¶
func (*SliceHelper) MapSlice2SimpleMap(data []map[string]interface{}, index, key string) map[string]interface{}
func (*SliceHelper) MapSliceDelete ¶
func (*SliceHelper) MapSliceDelete(slice []map[string]interface{}, index int) []map[string]interface{}
*
- @func: StrSliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) MapSliceReverse ¶
func (*SliceHelper) MapSliceReverse(arr []map[string]interface{}) ([]map[string]interface{}, error)
*
- @func: MapSliceReverse 将map slice倒过来排
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) Merge ¶
func (*SliceHelper) Merge(arr_1 []map[string]float64, arr_2 []map[string]float64) []map[string]float64
*
- @func: sliceMerge 合并两个slice
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) NarrowSlice ¶
func (*SliceHelper) NarrowSlice(arr []map[string]interface{}, amount int) []map[string]interface{}
*
- @func: NarrowSlice 缩短slice,取中间部分
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) Paginator ¶
func (*SliceHelper) Paginator(page, pageSize int, data []map[string]interface{}) []map[string]interface{}
*
- @func: Paginator 组装分页
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) Slice2MapByInt64ColumnAsKey ¶
func (*SliceHelper) Slice2MapByInt64ColumnAsKey(data []map[string]interface{}, index string) map[string]interface{}
func (*SliceHelper) SliceDelete ¶
func (*SliceHelper) SliceDelete(slice []interface{}, index int) []interface{}
*
- @func: SliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) StrSliceDelete ¶
func (*SliceHelper) StrSliceDelete(slice []string, index int) []string
*
- @func: StrSliceDelete 返回新slice(不包含指定的那个index键)
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) UniqueByLoop ¶
func (*SliceHelper) UniqueByLoop(slc []int) []int
*
- @func: UniqueByLoop 通过两重循环过滤重复元素
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) UniqueByMap ¶
func (*SliceHelper) UniqueByMap(slc []int) []int
*
- @func: UniqueByMap 通过map主键唯一的特性过滤重复元素
- @author Wiidz
- @date 2019-11-16
func (*SliceHelper) UniqueIntSlice ¶
func (sliceHelper *SliceHelper) UniqueIntSlice(slc []int) []int
*
- @func: UniqueIntSlice int slice去重
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) UniqueInterface ¶
func (*SliceHelper) UniqueInterface(slc []interface{}) []interface{}
*
- @func: UniqueInterface interface slice去重
- @author Wiidz
- @date 2019-11-06
func (*SliceHelper) UniqueStrSlice ¶
func (*SliceHelper) UniqueStrSlice(strSlice []string) []string
*
- @func: UniqueStrSlice str slice去重
- @author Wiidz
- @date 2019-11-16
type Snowflake ¶
A Snowflake struct holds the basic information needed for a snowflake generator worker
func NewSnowflake ¶
NewNode returns a new snowflake worker that can be used to generate snowflake IDs
func NewSnowflakeMax ¶
NewNode returns a new snowflake worker that can be used to generate snowflake IDs
type StrHelper ¶
type StrHelper struct{}
func (*StrHelper) Base64Decode ¶ added in v0.1.3
*
- @func: Base64_decode 解码
- @author Wiidz
- @date 2019-11-16
func (*StrHelper) Base64Encode ¶ added in v0.1.3
*
- @func: Base64_encode base64编码
- @author Wiidz
- @date 2019-11-16
func (*StrHelper) GetRandomString ¶
*
- @func: GetRandomString 获取指定位数的随机字符串
- @author Wiidz
- @date 2019-11-16
func (*StrHelper) GetWordsLength ¶
*
- @func: GetWordLength 文字=1,标点符号=0.5,获取长度
- @author Wiidz
- @date 2019-11-16
type StructHelper ¶
type StructHelper struct{}
func (*StructHelper) GetStructAllFields ¶ added in v0.5.2
func (*StructHelper) GetStructAllFields(target interface{})
*
- @func: GetStructAllFields 打印结构体的所有键值
- @author Wiidz
- @date 2019-11-16
func (*StructHelper) GetStructAllKV ¶ added in v0.5.2
func (*StructHelper) GetStructAllKV(target interface{})
*
- @func: GetStructAllFields 打印结构体的所有键值对
- @author Wiidz
- @date 2019-11-16
func (*StructHelper) GetStructAllMethods ¶ added in v0.5.2
func (*StructHelper) GetStructAllMethods(target interface{})
*
- @func: GetStructAllMethods 打印结构体的所有方法
- @author Wiidz
- @date 2019-11-16
func (*StructHelper) GetStructPointAllKV ¶ added in v0.5.2
func (*StructHelper) GetStructPointAllKV(target interface{})
*
- @func: GetStructAllFields 打印结构体的所有键值对
- @author Wiidz
- @date 2019-11-16
type TimeHelper ¶
type TimeHelper struct{}
func (*TimeHelper) BeautyTimeStamp ¶
func (*TimeHelper) BeautyTimeStamp(timeStamp, currentTime int64) string
func (*TimeHelper) FromTodayToTomorrowTimeStamp ¶
func (*TimeHelper) FromTodayToTomorrowTimeStamp() (today, tomorrow int64)
*
- @func: FromTodayToTomorrowTimeStamp 返回今天凌晨和明天凌晨的时间戳
- @author Wiidz
- @date 2019-11-16
func (*TimeHelper) GetISO8601 ¶
func (*TimeHelper) GetISO8601(date int64) string
*
- @func: GetISO8601 获取iso8601格式的时间
- @author Wiidz
- @date 2019-11-16
func (*TimeHelper) GetZeroTimeStamp ¶
func (*TimeHelper) GetZeroTimeStamp(d time.Time) time.Time
*
- @func: GetZeroTimeStamp 获取某一天的0点时间
- @author Wiidz
- @date 2019-11-16
func (*TimeHelper) LastDayOfTimeStamp ¶
func (timeHelper *TimeHelper) LastDayOfTimeStamp(d time.Time) int64
*
- @func: LastDayOfTimeStamp 获取本日最后一天的时间戳
- @author Wiidz
- @date 2019-11-16
type TypeHelper ¶
type TypeHelper struct{}
func (*TypeHelper) Empty ¶
func (typeHelper *TypeHelper) Empty(arg interface{}) bool
*
- @func: Empty 判断目标是否为空值或0
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Explode ¶
func (*TypeHelper) Explode(data string, sep string) []interface{}
*
- @func: Explode 字符串转slice, 接受混合类型
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) ExplodeFloat64 ¶
func (*TypeHelper) ExplodeFloat64(data string, sep string) []float64
*
- @func: Explode 字符串转int slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) ExplodeInt ¶
func (*TypeHelper) ExplodeInt(data string, sep string) []int
*
- @func: Explode 字符串转int slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) ExplodeInt64 ¶
func (*TypeHelper) ExplodeInt64(data string, sep string) []int64
*
- @func: Explode 字符串转int slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Float64Slice2IntSlice ¶
func (*TypeHelper) Float64Slice2IntSlice(slice []interface{}) []int
*
- @func: Float64SliceToInt float64 slice转换成 int slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Float64ToStr ¶
func (*TypeHelper) Float64ToStr(number float64) string
*
- @func: Str2Int 将字符串转为int
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) GetType ¶
func (*TypeHelper) GetType(params interface{}) string
*
- @func: GetType 获取目标的数据类型
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) If ¶
func (*TypeHelper) If(conditions bool, trueVal, falseVal interface{}) interface{}
*
- @func: If 三元运算符
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Implode ¶
func (typeHelper *TypeHelper) Implode(data interface{}, glue string) string
*
- @func: Implode 将slice转换成字符串
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Int2Str ¶
func (*TypeHelper) Int2Str(number int) string
*
- @func: Float64SliceToInt float64 slice转换成 int slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Int64Slice2IntSlice ¶
func (*TypeHelper) Int64Slice2IntSlice(int64_slice []int64) []int
func (*TypeHelper) Int64ToStr ¶
func (*TypeHelper) Int64ToStr(number int64) string
*
- @func: Int64ToStr int64转为str
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) InterfaceSlice2MapSlice ¶
func (*TypeHelper) InterfaceSlice2MapSlice(inter []interface{}) []map[string]interface{}
*
- @func: InterfaceSlice2MapSlice interface slice 转换 map slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) IsNil ¶
func (*TypeHelper) IsNil(i interface{}) bool
func (*TypeHelper) IsType ¶
func (*TypeHelper) IsType(needle interface{}, type_name string) bool
*
- @func: IsType 判断目标是否为指定类型的值
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) JsonDecode ¶
func (*TypeHelper) JsonDecode(json_str string) map[string]interface{}
*
- @func: JsonDecode 解码json
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) JsonDecodeInt64Slice ¶
func (*TypeHelper) JsonDecodeInt64Slice(json_str string) []int64
*
- @func: JsonDecode 解码json
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) JsonDecodeWithStruct ¶
func (*TypeHelper) JsonDecodeWithStruct(json_str string, istruct interface{}) interface{}
*
- @func: JsonDecode 解码json
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) JsonEncode ¶
func (*TypeHelper) JsonEncode(data interface{}) (string, error)
*
- @func: JsonEncode 编码json
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Map2InterfaceSlice ¶
func (*TypeHelper) Map2InterfaceSlice(data map[string]interface{}) []interface{}
*
- @func: Map2InterfaceSlice 将map转换成interface slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Str2Float64 ¶
func (*TypeHelper) Str2Float64(str string) float64
*
- @func: Str2Float64 str转为float64
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Str2Int ¶
func (*TypeHelper) Str2Int(str string) int
*
- @func: Str2Int 将字符串转为int
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Str2Int64 ¶
func (*TypeHelper) Str2Int64(str string) int64
*
- @func: Str2Int64 将字符串转为int64
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) Str2Int8 ¶
func (*TypeHelper) Str2Int8(str string) int8
*
- @func: Str2Int8 将字符串转为int8
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) StrSlice2InterfaceSlice ¶
func (*TypeHelper) StrSlice2InterfaceSlice(data []string) []interface{}
*
- @func: StrSlice2InterfaceSlice 字符串slice转interface slice
- @author Wiidz
- @date 2019-11-16
func (*TypeHelper) ToString ¶
func (*TypeHelper) ToString(data interface{}) string
*
- @func: ToString 将任何参数转换为字符串
- @author Wiidz
- @date 2019-11-16
Click to show internal directories.
Click to hide internal directories.