Documentation
¶
Index ¶
- func ByteToStr(b []byte) string
- func CallMethod(v interface{}, methodName string) (interface{}, bool)
- func Interpret(a interface{}) interface{}
- func IsBaseType(v interface{}) bool
- func IsStrType(v interface{}) (bool, string)
- func JsonChecker(v interface{}) (bool, string)
- func JsonDumps(m interface{}) (string, error)
- func JsonLoadsList(jsonStr string) ([]interface{}, error)
- func JsonLoadsMap(jsonStr string) (map[string]interface{}, error)
- func JsonLoadsObj(jsonStr string, o interface{}) (interface{}, error)
- func JsonUnmarshalObj(jsonStr string, o interface{}) (interface{}, error)
- func MapToStruct(inputMap interface{}, outputStruct interface{}) (interface{}, error)
- func ReflectToVal(v interface{}) reflect.Value
- func StrToByte(s string) (b []byte)
- func ToFloat32(v interface{}) (float32, error)
- func ToFloat64(v interface{}) (float64, error)
- func ToInt64(v interface{}) (int64, error)
- func ToStr(v interface{}) string
- func UniqByReflect(data interface{}) interface{}
- func UniqList(data interface{}) interface{}
- type InterfaceType
- type ValType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallMethod ¶ added in v1.2.1
func IsBaseType ¶
func IsBaseType(v interface{}) bool
func JsonChecker ¶ added in v1.2.1
StrChecker 判断v是不是一个字符串类型,首先判断是否为字符串,其次判断是否为json 注:基础类型也会返回true,如:"745934759",返回true,序列化为json.Number
func JsonLoadsMap ¶ added in v1.2.1
JsonLoadsMap Tip: map类型的json key必须是字符串;
func JsonLoadsObj ¶ added in v1.2.1
JsonLoadsObj 注:o必须是对象的指针
func JsonUnmarshalObj ¶ added in v1.2.1
JsonUnmarshalObj 注:o必须是对象的指针
func MapToStruct ¶ added in v1.2.1
func MapToStruct(inputMap interface{}, outputStruct interface{}) (interface{}, error)
func ReflectToVal ¶ added in v1.2.1
func UniqByReflect ¶ added in v1.2.1
func UniqByReflect(data interface{}) interface{}
Types ¶
type InterfaceType ¶
type InterfaceType int
const ( UnImplementInterface InterfaceType = 0 ListInterface InterfaceType = 1 MapInterface InterfaceType = 2 )
func GetInterfaceType ¶
func GetInterfaceType(i interface{}) InterfaceType
type ValType ¶
type ValType int
const ( UnKnownType ValType = 0 Str ValType = 1 Int ValType = 2 Int64 ValType = 3 Int32 ValType = 4 Uint ValType = 5 Uint64 ValType = 6 Uint32 ValType = 7 Float32 ValType = 8 Float64 ValType = 9 Bool ValType = 10 Map ValType = 21 Array ValType = 32 Slice ValType = 23 Struct ValType = 41 Ptr ValType = 42 Func ValType = 43 MapStrItf ValType = 61 MapIntItf ValType = 62 MapInt32Itf ValType = 63 MapInt64Itf ValType = 64 MapUintItf ValType = 65 MapUint32Itf ValType = 66 MapUint64Itf ValType = 67 MapFloatItf ValType = 68 MapFloat64Itf ValType = 69 MapStructItf ValType = 70 MapFuncItf ValType = 71 MapStrToStr ValType = 72 MapIntToInt ValType = 73 MapInt64ToInt64 ValType = 74 MapFloat32ToFloat32 ValType = 75 MapFloat64ToFloat64 ValType = 76 ListItf ValType = 81 ListStr ValType = 82 ListInt ValType = 83 ListInt64 ValType = 84 ListInt32 ValType = 85 ListUint ValType = 86 ListUint32 ValType = 87 ListUint64 ValType = 88 ListFloat32 ValType = 89 ListFloat64 ValType = 90 ListBool ValType = 91 )
Click to show internal directories.
Click to hide internal directories.