dtype

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

数据转换

Index

Constants

This section is empty.

Variables

View Source
var (
	RefTypeStr     = reflect.TypeOf("")
	RefTypeInt     = reflect.TypeOf(0)
	RefTypeInt32   = reflect.TypeOf(int32(0))
	RefTypeInt64   = reflect.TypeOf(int64(0))
	RefTypeFloat32 = reflect.TypeOf(float32(0))
	RefTypeFloat64 = reflect.TypeOf(float64(0))
	RefTypeBool    = reflect.TypeOf(false)
)

Functions

func BoolElem

func BoolElem() reflect.Value

func BoolSliceElem

func BoolSliceElem() reflect.Value

func DeepCopy

func DeepCopy(dst, src interface{}) error

深度拷贝对象

func Elem

func Elem(v reflect.Type) reflect.Value

func Float32Elem

func Float32Elem() reflect.Value

func Float32SliceElem

func Float32SliceElem() reflect.Value

func Float64Elem

func Float64Elem() reflect.Value

func Float64SliceElem

func Float64SliceElem() reflect.Value

func Int32Elem

func Int32Elem() reflect.Value

func Int32MapElem

func Int32MapElem(v reflect.Type) reflect.Value

func Int32SliceElem

func Int32SliceElem() reflect.Value

func Int64Elem

func Int64Elem() reflect.Value

func Int64MapElem

func Int64MapElem(v reflect.Type) reflect.Value

func Int64SliceElem

func Int64SliceElem() reflect.Value

func IntElem

func IntElem() reflect.Value

func IntMapElem

func IntMapElem(v reflect.Type) reflect.Value

Int Map

func IntSliceElem

func IntSliceElem() reflect.Value

func MapElem

func MapElem(k, v reflect.Type) reflect.Value

反射创建MAP (以 .Addr.Interface() 获取指针数据)

func ParseBool

func ParseBool(v interface{}) bool

ParseBool convert interface to bool.

func ParseFloat32

func ParseFloat32(v interface{}) float32

ParseFloat32 convert interface to float32.

func ParseFloat64

func ParseFloat64(v interface{}) float64

ParseFloat64 convert interface to float64.

func ParseInt

func ParseInt(v interface{}) int

ParseInt 转为int

func ParseInt32

func ParseInt32(v interface{}) int32

ParseInt32 convert interface to int32.

func ParseInt64

func ParseInt64(v interface{}) int64

ParseInt64 convert interface to int64.

func ParseSlice

func ParseSlice(v interface{}) []interface{}

func ParseStr

func ParseStr(v interface{}) string

ParseStr 转为字符串

func ParseStrSlice

func ParseStrSlice(v []interface{}) []string

ParseStrSlice convert []interface to []string

func ParseUint

func ParseUint(v interface{}) uint

ParseUint convert interface to int.

func ParseUint32

func ParseUint32(v interface{}) uint32

ParseUint32 convert interface to int32.

func ParseUint64

func ParseUint64(v interface{}) uint64

ParseUint64 convert interface to int64.

func Ptr

func Ptr(v reflect.Type) reflect.Value

反射创建结构体 (以 .Addr.Interface() 获取指针数据)

func SliceElem

func SliceElem(v reflect.Type) reflect.Value

反射创建切片 (以 .Addr.Interface() 获取指针数据)

func SliceTwoElem

func SliceTwoElem(v reflect.Type) reflect.Value

反射创建切片 (以 .Addr.Interface() 获取指针数据)

func StrElem

func StrElem() reflect.Value

func StrMapElem

func StrMapElem(v reflect.Type) reflect.Value

Str Map

func StrSliceElem

func StrSliceElem() reflect.Value

func StructToDict

func StructToDict(data interface{}) map[string]interface{}

StructToDict 结构体转字典 (不支持嵌套)

func ToDict

func ToDict(data interface{}) map[string]interface{}

ToDict 转换为字典数据(MAP)

func ToJson

func ToJson(data interface{}) []byte

ToJson 转换为JSON数据

func ToStruct

func ToStruct(data interface{}, obj interface{}) error

ToStruct 转换结构体数据

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL