Documentation
¶
Index ¶
- func Bytes2Int(b []byte) int
- func Empty(arg interface{}) bool
- func Explode(data string, sep string) []interface{}
- func ExplodeFloat64(data string, sep string) []float64
- func ExplodeInt(data string, sep string) []int
- func ExplodeInt8(data string, sep string) []int8
- func ExplodeInt64(data string, sep string) []int64
- func ExplodeStr(data string, sep string) []string
- func ExplodeUint64(data string, sep string) []uint64
- func Float64Slice2Int(data []float64) []int
- func Float64Slice2Int8(data []float64) []int8
- func Float64Slice2Str(data []float64) []string
- func Float64Slice2Uint64(data []float64) []uint64
- func Float64ToInt(number float64) int
- func Float64ToInt8(number float64) int8
- func Float64ToInt64(number float64) int64
- func Float64ToStr(number float64) string
- func Float64ToUint64(number float64) uint64
- func ForceFloat64(value interface{}) float64
- func ForceFloat64Slice(value interface{}) []float64
- func ForceInt(value interface{}) int
- func ForceInt8(value interface{}) int8
- func ForceInt8Slice(value interface{}) []int8
- func ForceIntSlice(value interface{}) []int
- func ForceStrSlice(value interface{}) []string
- func ForceString(value interface{}) string
- func ForceUint64(value interface{}) uint64
- func ForceUint64Slice(value interface{}) []uint64
- func GetType(params interface{}) string
- func If(conditions bool, trueVal, falseVal interface{}) interface{}
- func Implode(data interface{}, glue string) string
- func ImplodeInt(data []int, glue string) string
- func ImplodeInt8(data []int8, glue string) string
- func ImplodeStr(data []string, glue string) string
- func ImplodeUint64(data []uint64, glue string) string
- func Int2Bytes(n int) []byte
- func Int2Str(number int) string
- func Int8Slice2Float64(data []int8) []float64
- func Int8Slice2Int(data []int8) []int
- func Int8Slice2Str(data []int8) []string
- func Int8Slice2Uint64(data []int8) []uint64
- func Int8ToStr(number int8) string
- func Int64ToStr(number int64) string
- func IntSlice2Float64(data []int) []float64
- func IntSlice2Int8(data []int) []int8
- func IntSlice2Str(data []int) []string
- func IntSlice2Uint64(data []int) []uint64
- func InterfaceMapToStr(data map[string]interface{}) map[string]string
- func InterfaceSlice2MapSlice(inter []interface{}) []map[string]interface{}
- func IsNil(i interface{}) bool
- func IsType(needle interface{}, type_name string) bool
- func JsonDecode(jsonStr string) (parsedData interface{})
- func JsonDecodeFloat64Slice(jsonStr string) []float64
- func JsonDecodeInt64Slice(jsonStr string, config *jsoniter.Config) []int64
- func JsonDecodeIntSlice(jsonStr string, config *jsoniter.Config) []int
- func JsonDecodeMap(jsonStr string) (parsedData map[string]interface{})
- func JsonDecodeMapStr(jsonStr string) (parsedData map[string]string)
- func JsonDecodeMapWithConfig(jsonStr string, config jsoniter.Config) (parsedData map[string]interface{})
- func JsonDecodeSliceMap(jsonStr string) (parsedData []map[string]interface{})
- func JsonDecodeStrSlice(jsonStr string) []string
- func JsonDecodeUint64Slice(jsonStr string) []uint64
- func JsonDecodeWithStruct(jsonStr string, iStruct interface{}) error
- func JsonEncode(data interface{}) (string, error)
- func JsonEncodeDecodeMap(data interface{}) (map[string]interface{}, error)
- func Map2InterfaceSlice(data map[string]interface{}) []interface{}
- func Str2Float64(str string) float64
- func Str2Int(str string) int
- func Str2Int8(str string) int8
- func Str2Int64(str string) int64
- func Str2Uint(str string) (res uint, err error)
- func Str2Uint64(str string) uint64
- func StrMapToInterface(data map[string]string) map[string]interface{}
- func StrSlice2Float64(data []string) []float64
- func StrSlice2Int(data []string) []int
- func StrSlice2Int8(data []string) []int8
- func StrSlice2InterfaceSlice(data []string) []interface{}
- func StrSlice2Uint64(data []string) []uint64
- func StructToMap(obj interface{}) (result map[string]interface{}, err error)
- func ToString(data interface{}) string
- func Uint64Slice2Float64(data []uint64) []float64
- func Uint64Slice2Int(data []uint64) []int
- func Uint64Slice2Int8(data []uint64) []int8
- func Uint64Slice2Str(data []uint64) []string
- func Uint64ToStr(number uint64) string
- func UintToStr(number uint) string
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Empty ¶
func Empty(arg interface{}) bool
*
- @func: Empty 判断目标是否为空值或0
- @author Wiidz
- @date 2019-11-16
func ExplodeInt8 ¶ added in v1.5.6
ExplodeInt8 字符串转int8 slice
func ExplodeUint64 ¶ added in v1.5.6
*
- @func: ExplodeUint64 字符串转int slice
- @author Wiidz
- @date 2019-11-16
func Float64Slice2Int ¶ added in v1.5.6
Float64Slice2Int Float64切片转int切片
func Float64Slice2Int8 ¶ added in v1.5.6
Float64Slice2Int8 Float64切片转int8切片
func Float64Slice2Str ¶ added in v1.5.6
Float64Slice2Str Float64切片转str切片
func Float64Slice2Uint64 ¶ added in v1.5.6
Float64Slice2Uint64 Float64切片转uint64切片
func Float64ToInt8 ¶ added in v1.5.6
*
- @func: Float64ToInt8 将字符串转为int8
- @author Wiidz
- @date 2019-11-16
func Float64ToInt64 ¶ added in v1.5.6
Float64ToInt64 float64转为int64
func Float64ToUint64 ¶ added in v1.5.6
*
- @func: Float64ToUint64 将字符串转为int8
- @author Wiidz
- @date 2019-11-16
func ForceFloat64 ¶ added in v1.5.6
func ForceFloat64(value interface{}) float64
ForceFloat64 强制转换为Float64
func ForceFloat64Slice ¶ added in v1.5.6
func ForceFloat64Slice(value interface{}) []float64
ForceFloat64Slice 强制转换成float64切片
func ForceInt8Slice ¶ added in v1.5.6
func ForceInt8Slice(value interface{}) []int8
ForceInt8Slice 强制转换成int8切片
func ForceIntSlice ¶ added in v1.5.6
func ForceIntSlice(value interface{}) []int
ForceIntSlice 强制转换成int64切片
func ForceStrSlice ¶ added in v1.5.6
func ForceStrSlice(value interface{}) []string
ForceStrSlice 强制转换成str切片
func ForceString ¶ added in v1.5.6
func ForceString(value interface{}) string
ForceString 强制转换为string
func ForceUint64 ¶ added in v1.5.6
func ForceUint64(value interface{}) uint64
ForceUint64 强制转换为Uint64
func ForceUint64Slice ¶ added in v1.5.6
func ForceUint64Slice(value interface{}) []uint64
ForceUint64Slice 强制转换成uint64切片
func GetType ¶
func GetType(params interface{}) string
*
- @func: GetType 获取目标的数据类型
- @author Wiidz
- @date 2019-11-16
func If ¶
func If(conditions bool, trueVal, falseVal interface{}) interface{}
*
- @func: If 三元运算符
- @author Wiidz
- @date 2019-11-16
func ImplodeInt ¶ added in v1.5.6
*
- @func: ImplodeInt 将int slice转换成字符串
- @author Wiidz
- @date 2019-11-16
func ImplodeInt8 ¶ added in v1.5.6
ImplodeInt8 将Int8切片转换成string
func ImplodeStr ¶ added in v1.5.6
ImplodeStr 将 str slice转换成字符串
func ImplodeUint64 ¶ added in v1.5.6
ImplodeUint64 将slice转换成字符串
func Int8Slice2Float64 ¶ added in v1.5.6
Int8Slice2Float64 Int8切片转float64切片
func Int8Slice2Int ¶ added in v1.5.6
Int8Slice2Int Int8切片转int切片
func Int8Slice2Str ¶ added in v1.5.6
Int8Slice2Str Int8切片转str切片
func Int8Slice2Uint64 ¶ added in v1.5.6
Int8Slice2Uint64 Int8切片转uint64切片
func IntSlice2Float64 ¶ added in v1.5.6
IntSlice2Float64 Int切片转float64切片
func IntSlice2Int8 ¶ added in v1.5.6
IntSlice2Int8 Int切片转int8切片
func IntSlice2Uint64 ¶ added in v1.5.6
IntSlice2Uint64 Int切片转uint64切片
func InterfaceMapToStr ¶ added in v1.5.6
InterfaceMapToStr 把map[string]interface{} 转换成 map[string]string
func InterfaceSlice2MapSlice ¶
func InterfaceSlice2MapSlice(inter []interface{}) []map[string]interface{}
InterfaceSlice2MapSlice
func JsonDecode ¶
func JsonDecode(jsonStr string) (parsedData interface{})
func JsonDecodeFloat64Slice ¶ added in v1.5.6
JsonDecodeFloat64Slice json解码至float6464切片
func JsonDecodeInt64Slice ¶
JsonDecodeInt64Slice json解码至int64切片
func JsonDecodeIntSlice ¶ added in v1.5.6
JsonDecodeIntSlice json解码至int切片
func JsonDecodeMap ¶ added in v1.5.6
JsonDecodeMap 修复
func JsonDecodeMapStr ¶ added in v1.5.6
func JsonDecodeMapWithConfig ¶ added in v1.5.6
func JsonDecodeMapWithConfig(jsonStr string, config jsoniter.Config) (parsedData map[string]interface{})
JsonDecodeMapWithConfig UseNumber:true 1.JSON 数值类型的默认解析规则 Go 的 encoding/json 库(以及兼容模式的 jsoniter)在解析 JSON 数值时,若数值较大(超过 int64 范围),会优先解析为 float64 类型 。例如,10000001 会被解析为 1.0000001e+07,这是浮点数的科学计数法表示。 2.map[string]interface{} 的类型推断 使用 map[string]interface{} 接收 JSON 数据时,解析器会根据数值大小自动选择 float64 或 int 类型。由于 10000001 在 Go 的 int 类型范围内(32 位系统下可能超出),解析器可能仍选择 float64 以避免溢出风险。
func JsonDecodeSliceMap ¶ added in v1.5.6
func JsonDecodeStrSlice ¶ added in v1.5.6
JsonDecodeStrSlice json解码至str切片
func JsonDecodeUint64Slice ¶ added in v1.5.6
JsonDecodeUint64Slice json解码至uint64切片
func JsonDecodeWithStruct ¶
JsonDecodeWithStruct 带结构体的json解码
temp := ReGeoRes{}
typeHelper.JsonDecodeWithStruct(tempStr,&temp)
func JsonEncodeDecodeMap ¶ added in v1.5.6
JsonEncodeDecodeMap 将任何数据转换成map[string]interface{}
func Map2InterfaceSlice ¶
func Map2InterfaceSlice(data map[string]interface{}) []interface{}
Map2InterfaceSlice 将map转换成interface slice
func StrMapToInterface ¶ added in v1.5.6
StrMapToInterface 把map[string]string 转换成 map[string]interface{}
func StrSlice2Float64 ¶ added in v1.5.6
StrSlice2Float64 Str切片转float64切片
func StrSlice2Int8 ¶ added in v1.5.6
StrSlice2Int8 Str切片转int8切片
func StrSlice2InterfaceSlice ¶
func StrSlice2InterfaceSlice(data []string) []interface{}
*
- @func: StrSlice2InterfaceSlice 字符串slice转interface slice
- @author Wiidz
- @date 2019-11-16
func StrSlice2Uint64 ¶ added in v1.5.6
StrSlice2Uint64 Str切片转uint64切片
func StructToMap ¶ added in v1.5.6
StructToMap 结构体转换为map
func ToString ¶
func ToString(data interface{}) string
*
- @func: ToString 将任何参数转换为字符串
- @author Wiidz
- @date 2019-11-16
func Uint64Slice2Float64 ¶ added in v1.5.6
Uint64Slice2Float64 Uint64切片转float64切片
func Uint64Slice2Int ¶ added in v1.5.6
Uint64Slice2Int Uint64切片转int切片
func Uint64Slice2Int8 ¶ added in v1.5.6
Uint64Slice2Int8 Uint64切片转int8切片
func Uint64Slice2Str ¶ added in v1.5.6
Uint64Slice2Str Uint64切片转str切片
func Uint64ToStr ¶ added in v1.5.6
*
- @func: Float64SliceToInt float64 slice转换成 int slice
- @author Wiidz
- @date 2019-11-16
Types ¶
type Kind ¶ added in v1.5.6
type Kind string
const ( Invalid Kind = "invalid" Bool Kind = "bool" Int Kind = "int" Int8 Kind = "int8" Int16 Kind = "int16" Int32 Kind = "int32" Int64 Kind = "int64" Uint Kind = "uint" Uint8 Kind = "uint8" Uint16 Kind = "uint16" Uint32 Kind = "uint32" Uint64 Kind = "uint64" Uintptr Kind = "uintptr" Float32 Kind = "float32" Float64 Kind = "float64" Complex64 Kind = "complex64" Complex128 Kind = "complex128" Array Kind = "" Chan Kind = "" Func Kind = "" Interface Kind = "interface{}" Map Kind = "" Ptr Kind = "" Slice Kind = "" String Kind = "string" Struct Kind = "" UnsafePointer Kind = "" )