Documentation ¶
Index ¶
- Variables
- func Bool(i interface{}, def ...bool) bool
- func Byte(i interface{}) byte
- func Bytes(i interface{}) []byte
- func Convert(i interface{}, t string, params ...interface{}) interface{}
- func Duration(i interface{}) time.Duration
- func Float(i interface{}, def ...float32) float32
- func Float32(i interface{}, def ...float32) float32
- func Float64(i interface{}, def ...float64) float64
- func Floats(i interface{}) []float64
- func InArray(needle, arr interface{}) bool
- func Int(i interface{}, def ...int) int
- func Int16(i interface{}, def ...int16) int16
- func Int32(i interface{}, def ...int32) int32
- func Int64(v interface{}, def ...int64) int64
- func Int8(i interface{}, def ...int8) int8
- func Interfaces(i interface{}) []interface{}
- func Ints(i interface{}) []int
- func Map(value interface{}, tags ...string) map[string]interface{}
- func MapDeep(value interface{}, tags ...string) map[string]interface{}
- func Maps(value interface{}, tags ...string) []map[string]interface{}
- func MapsDeep(value interface{}, tags ...string) []map[string]interface{}
- func Rune(i interface{}) rune
- func Runes(i interface{}) []rune
- func SliceAny(i interface{}) []interface{}
- func SliceFloat(i interface{}) []float64
- func SliceInt(i interface{}) []int
- func SliceMap(i interface{}) []map[string]interface{}
- func SliceMapDeep(i interface{}) []map[string]interface{}
- func SliceStr(i interface{}) []string
- func SliceStruct(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)
- func SliceStructDeep(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)
- func String(v interface{}, def ...string) string
- func Strings(i interface{}) []string
- func Struct(params interface{}, pointer interface{}, mapping ...map[string]string) error
- func StructDeep(params interface{}, pointer interface{}, mapping ...map[string]string) error
- func Structs(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)
- func StructsDeep(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)
- func Time(i interface{}, format ...string) time.Time
- func Uint(i interface{}, def ...uint) uint
- func Uint16(i interface{}, def ...uint16) uint16
- func Uint32(i interface{}, def ...uint32) uint32
- func Uint64(i interface{}, def ...uint64) uint64
- func Uint8(i interface{}, def ...uint8) uint8
- func XTime(i interface{}, format ...string) *xtime.Time
- type T
- type THash
- type TMap
- type TMapAny
- type TMapInt
- type TMapInt32
- type TMapInt64
- type TMapString
- type TSlice
- type TSliceAny
- type TSliceInt64
- type TSliceString
- type Type
- func (t Type) Any(def ...interface{}) interface{}
- func (t Type) Bool(def ...bool) bool
- func (t Type) Float32(def ...float32) float32
- func (t Type) Float64(def ...float64) float64
- func (t Type) Hash() THash
- func (t Type) Int(def ...int) int
- func (t Type) Int16(def ...int16) int16
- func (t Type) Int32(def ...int32) int32
- func (t Type) Int64(def ...int64) int64
- func (t Type) Int8(def ...int8) int8
- func (t Type) Map() TMap
- func (t Type) MapAny() TMapAny
- func (t Type) MapInt64() TMapInt64
- func (t Type) MapStrAny() map[string]interface{}
- func (t Type) MapString() TMapString
- func (t Type) Slice() TSlice
- func (t Type) SliceAny() []interface{}
- func (t Type) SliceHash() []THash
- func (t Type) SliceInt64() []int64
- func (t Type) SliceMapStrAny() []map[string]interface{}
- func (t Type) SliceString() []string
- func (t Type) String(def ...string) string
- func (t Type) ToMapType(mapType reflect.Type) interface{}
- func (t Type) ToSliceType(sliceType reflect.Type) interface{}
- func (t Type) ToStructType(structType reflect.Type) interface{}
- func (t Type) ToType(typ reflect.Type) interface{}
- func (t Type) Uint(def ...uint) uint
- func (t Type) Uint16(def ...uint16) uint16
- func (t Type) Uint32(def ...uint32) uint32
- func (t Type) Uint64(def ...uint64) uint64
- func (t Type) Uint8(def ...uint8) uint8
Constants ¶
This section is empty.
Variables ¶
View Source
var AnyType = reflect.TypeOf((interface{})(nil))
View Source
var BoolType = reflect.TypeOf(Bool(false))
View Source
var Complex128Type = reflect.TypeOf(complex128(0))
View Source
var Complex64Type = reflect.TypeOf(complex64(0))
View Source
var Float32Type = reflect.TypeOf(Float32(0))
View Source
var Float64Type = reflect.ValueOf(Float64(0))
View Source
var Int16Type = reflect.TypeOf(int16(0))
View Source
var Int32Type = reflect.TypeOf(int32(0))
View Source
var Int64Type = reflect.TypeOf(int64(0))
View Source
var Int8Type = reflect.TypeOf(int8(0))
View Source
var IntType = reflect.TypeOf(int(0))
View Source
var SliceAnyType = reflect.TypeOf([]interface{}{})
基础slice数据类型
View Source
var SliceBoolType = reflect.TypeOf([]bool{})
View Source
var SliceComplex128Type = reflect.TypeOf([]complex128{})
View Source
var SliceComplex64Type = reflect.TypeOf([]complex64{})
View Source
var SliceFloat32Type = reflect.TypeOf([]float32{})
View Source
var SliceFloat64Type = reflect.TypeOf([]float64{})
View Source
var SliceInt16Type = reflect.TypeOf([]int16{})
View Source
var SliceInt32Type = reflect.TypeOf([]int32{})
View Source
var SliceInt64Type = reflect.TypeOf([]int64{})
View Source
var SliceInt8Type = reflect.TypeOf([]int8{})
View Source
var SliceIntType = reflect.TypeOf([]int{})
View Source
var SliceStringType = reflect.TypeOf([]string{})
View Source
var SliceUint16Type = reflect.TypeOf([]uint16{})
View Source
var SliceUint32Type = reflect.TypeOf([]uint32{})
View Source
var SliceUint64Type = reflect.TypeOf([]uint64{})
View Source
var SliceUint8Type = reflect.TypeOf([]uint8{})
View Source
var SliceUintType = reflect.TypeOf([]uint{})
View Source
var StringType = reflect.TypeOf(string(""))
View Source
var Uint16Type = reflect.TypeOf(uint16(0))
View Source
var Uint32Type = reflect.TypeOf(uint32(0))
View Source
var Uint64Type = reflect.TypeOf(uint64(0))
View Source
var Uint8Type = reflect.TypeOf(uint8(0))
View Source
var UintType = reflect.TypeOf(uint(0))
Functions ¶
func Convert ¶
func Convert(i interface{}, t string, params ...interface{}) interface{}
Convert converts the variable <i> to the type <t>, the type <t> is specified by string. The unnecessary parameter <params> is used for additional parameter passing.
func Interfaces ¶
func Interfaces(i interface{}) []interface{}
Interfaces converts <i> to []interface{}.
func SliceMapDeep ¶
func SliceMapDeep(i interface{}) []map[string]interface{}
SliceMapDeep is alias of MapsDeep.
func SliceStruct ¶
SliceStruct is alias of Structs.
func SliceStructDeep ¶
func SliceStructDeep(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)
SliceStructDeep is alias of StructsDeep.
func StructDeep ¶
使用字典map设置struct字段值包括内嵌struct params 设置struct字段值的数据字典, 字段名不区分大小写 mapping 字典键名key与struct字段名映射关系
func StructsDeep ¶
Types ¶
type T ¶
type T interface { Any(def ...interface{}) interface{} String(def ...string) string Float32(def ...float32) float32 Float64(def ...float64) float64 Int(def ...int) int Int8(def ...int8) int8 Int16(def ...int16) int16 Int32(def ...int32) int32 Int64(def ...int64) int64 Uint(def ...uint) uint Uint8(def ...uint8) uint8 Uint16(def ...uint16) uint16 Uint32(def ...uint32) uint32 Uint64(def ...uint64) uint64 Bool(def ...bool) bool Slice() TSlice SliceAny() []interface{} SliceMapStrAny() []map[string]interface{} SliceHash() []THash SliceString() []string SliceInt64() []int64 ToSliceType(sliceType reflect.Type) interface{} Map() TMap MapAny() TMapAny MapString() TMapString MapInt64() TMapInt64 MapStrAny() map[string]interface{} Hash() THash ToMapType(mapType reflect.Type) interface{} ToStructType(structType reflect.Type) interface{} ToType(typ reflect.Type) interface{} }
type TMapString ¶
type TSliceInt64 ¶
type TSliceInt64 []int64
type TSliceString ¶
type TSliceString []string
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
func (Type) MapString ¶
func (t Type) MapString() TMapString
func (Type) SliceInt64 ¶
func (Type) SliceMapStrAny ¶
func (Type) SliceString ¶
func (Type) ToSliceType ¶
func (Type) ToStructType ¶
Click to show internal directories.
Click to hide internal directories.