typeutil

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsArray

func IsArray(value interface{}) bool

func IsArrayOrSlice

func IsArrayOrSlice(value interface{}) bool

func IsSlice

func IsSlice(value interface{}) bool

func MustStructToMap

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

func MustToBool

func MustToBool(value interface{}) bool

func MustToBoolArray

func MustToBoolArray(value interface{}) []bool

func MustToByte

func MustToByte(value interface{}) byte

func MustToByteArray

func MustToByteArray(value interface{}) []byte

func MustToComplex128

func MustToComplex128(value interface{}) complex128

func MustToComplex128Array

func MustToComplex128Array(value interface{}) []complex128

func MustToComplex64

func MustToComplex64(value interface{}) complex64

func MustToComplex64Array

func MustToComplex64Array(value interface{}) []complex64

func MustToFloat32

func MustToFloat32(value interface{}) float32

func MustToFloat32Array

func MustToFloat32Array(value interface{}) []float32

func MustToFloat64

func MustToFloat64(value interface{}) float64

func MustToFloat64Array

func MustToFloat64Array(value interface{}) []float64

func MustToInt

func MustToInt(value interface{}) int

func MustToInt16

func MustToInt16(value interface{}) int16

func MustToInt16Array

func MustToInt16Array(value interface{}) []int16

func MustToInt32

func MustToInt32(value interface{}) int32

func MustToInt32Array

func MustToInt32Array(value interface{}) []int32

func MustToInt64

func MustToInt64(value interface{}) int64

func MustToInt64Array

func MustToInt64Array(value interface{}) []int64

func MustToInt8

func MustToInt8(value interface{}) int8

func MustToInt8Array

func MustToInt8Array(value interface{}) []int8

func MustToIntArray

func MustToIntArray(value interface{}) []int

func MustToInterfaceArray

func MustToInterfaceArray(value interface{}) []interface{}

func MustToMap

func MustToMap(value interface{}) map[string]interface{}

func MustToMapArray

func MustToMapArray(value interface{}) []map[string]interface{}

func MustToRune

func MustToRune(value interface{}) rune

func MustToRuneArray

func MustToRuneArray(value interface{}) []rune

func MustToString

func MustToString(value interface{}) string

func MustToStringArray

func MustToStringArray(value interface{}) []string

func MustToTime

func MustToTime(value interface{}) time.Time

func MustToTimeArray

func MustToTimeArray(value interface{}) []time.Time

func MustToUint

func MustToUint(value interface{}) uint

func MustToUint16

func MustToUint16(value interface{}) uint16

func MustToUint16Array

func MustToUint16Array(value interface{}) []uint16

func MustToUint32

func MustToUint32(value interface{}) uint32

func MustToUint32Array

func MustToUint32Array(value interface{}) []uint32

func MustToUint64

func MustToUint64(value interface{}) uint64

func MustToUint64Array

func MustToUint64Array(value interface{}) []uint64

func MustToUint8

func MustToUint8(value interface{}) uint8

func MustToUint8Array

func MustToUint8Array(value interface{}) []uint8

func MustToUintArray

func MustToUintArray(value interface{}) []uint

func MustToUintptr

func MustToUintptr(value interface{}) uintptr

func MustToUintptrArray

func MustToUintptrArray(value interface{}) []uintptr

func StructToMap

func StructToMap(data interface{}) (result map[string]interface{}, err error)

func ToBool

func ToBool(value interface{}, defaultValue bool) bool

func ToBoolArray

func ToBoolArray(value interface{}, defaultValue []bool) []bool

func ToByte

func ToByte(value interface{}, defaultValue byte) byte

func ToByteArray

func ToByteArray(value interface{}, defaultValue []byte) []byte

func ToComplex128

func ToComplex128(value interface{}, defaultValue complex128) complex128

func ToComplex128Array

func ToComplex128Array(value interface{}, defaultValue []complex128) []complex128

func ToComplex64

func ToComplex64(value interface{}, defaultValue complex64) complex64

func ToComplex64Array

func ToComplex64Array(value interface{}, defaultValue []complex64) []complex64

func ToFloat32

func ToFloat32(value interface{}, defaultValue float32) float32

func ToFloat32Array

func ToFloat32Array(value interface{}, defaultValue []float32) []float32

func ToFloat64

func ToFloat64(value interface{}, defaultValue float64) float64

func ToFloat64Array

func ToFloat64Array(value interface{}, defaultValue []float64) []float64

func ToInt

func ToInt(value interface{}, defaultValue int) int

func ToInt16

func ToInt16(value interface{}, defaultValue int16) int16

func ToInt16Array

func ToInt16Array(value interface{}, defaultValue []int16) []int16

func ToInt32

func ToInt32(value interface{}, defaultValue int32) int32

func ToInt32Array

func ToInt32Array(value interface{}, defaultValue []int32) []int32

func ToInt64

func ToInt64(value interface{}, defaultValue int64) int64

func ToInt64Array

func ToInt64Array(value interface{}, defaultValue []int64) []int64

func ToInt8

func ToInt8(value interface{}, defaultValue int8) int8

func ToInt8Array

func ToInt8Array(value interface{}, defaultValue []int8) []int8

func ToIntArray

func ToIntArray(value interface{}, defaultValue []int) []int

func ToInterfaceArray

func ToInterfaceArray(value interface{}) ([]interface{}, bool)

func ToMap

func ToMap(value interface{}, defaultValue map[string]interface{}) map[string]interface{}

func ToMapArray

func ToMapArray(value interface{}, defaultValue []map[string]interface{}) []map[string]interface{}

func ToRune

func ToRune(value interface{}, defaultValue rune) rune

func ToRuneArray

func ToRuneArray(value interface{}, defaultValue []rune) []rune

func ToString

func ToString(value interface{}, defaultValue string) string

func ToStringArray

func ToStringArray(value interface{}, defaultValue []string) []string

func ToTime

func ToTime(value interface{}, defaultValue time.Time) time.Time

func ToTimeArray

func ToTimeArray(value interface{}, defaultValue []time.Time) []time.Time

func ToUint

func ToUint(value interface{}, defaultValue uint) uint

func ToUint16

func ToUint16(value interface{}, defaultValue uint16) uint16

func ToUint16Array

func ToUint16Array(value interface{}, defaultValue []uint16) []uint16

func ToUint32

func ToUint32(value interface{}, defaultValue uint32) uint32

func ToUint32Array

func ToUint32Array(value interface{}, defaultValue []uint32) []uint32

func ToUint64

func ToUint64(value interface{}, defaultValue uint64) uint64

func ToUint64Array

func ToUint64Array(value interface{}, defaultValue []uint64) []uint64

func ToUint8

func ToUint8(value interface{}, defaultValue uint8) uint8

func ToUint8Array

func ToUint8Array(value interface{}, defaultValue []uint8) []uint8

func ToUintArray

func ToUintArray(value interface{}, defaultValue []uint) []uint

func ToUintptr

func ToUintptr(value interface{}, defaultValue uintptr) uintptr

func ToUintptrArray

func ToUintptrArray(value interface{}, defaultValue []uintptr) []uintptr

Types

type AnyType

type AnyType struct {
	// contains filtered or unexported fields
}

func Any

func Any(v interface{}) AnyType

任意类型

func (AnyType) Get

func (a AnyType) Get(key interface{}) (AnyType, bool)

获取指定索引的值(适用于 array, slice, map)

func (AnyType) MustGet

func (a AnyType) MustGet(key interface{}) AnyType

获取指定索引的值(适用于 array, slice, map),如果不存在则报错

func (AnyType) MustToBool

func (a AnyType) MustToBool() bool

func (AnyType) MustToByte

func (a AnyType) MustToByte() byte

func (AnyType) MustToComplex128

func (a AnyType) MustToComplex128() complex128

func (AnyType) MustToComplex64

func (a AnyType) MustToComplex64() complex64

func (AnyType) MustToFloat32

func (a AnyType) MustToFloat32() float32

func (AnyType) MustToFloat64

func (a AnyType) MustToFloat64() float64

func (AnyType) MustToInt

func (a AnyType) MustToInt() int

func (AnyType) MustToInt16

func (a AnyType) MustToInt16() int16

func (AnyType) MustToInt32

func (a AnyType) MustToInt32() int32

func (AnyType) MustToInt64

func (a AnyType) MustToInt64() int64

func (AnyType) MustToInt8

func (a AnyType) MustToInt8() int8

func (AnyType) MustToMap

func (a AnyType) MustToMap() map[string]interface{}

func (AnyType) MustToRune

func (a AnyType) MustToRune() rune

func (AnyType) MustToString

func (a AnyType) MustToString() string

func (AnyType) MustToTime

func (a AnyType) MustToTime() time.Time

func (AnyType) MustToUint

func (a AnyType) MustToUint() uint

func (AnyType) MustToUint16

func (a AnyType) MustToUint16() uint16

func (AnyType) MustToUint32

func (a AnyType) MustToUint32() uint32

func (AnyType) MustToUint64

func (a AnyType) MustToUint64() uint64

func (AnyType) MustToUint8

func (a AnyType) MustToUint8() uint8

func (AnyType) MustToUintptr

func (a AnyType) MustToUintptr() uintptr

func (AnyType) ToBool

func (a AnyType) ToBool(defaultValue bool) bool

func (AnyType) ToByte

func (a AnyType) ToByte(defaultValue byte) byte

func (AnyType) ToComplex128

func (a AnyType) ToComplex128(defaultValue complex128) complex128

func (AnyType) ToComplex64

func (a AnyType) ToComplex64(defaultValue complex64) complex64

func (AnyType) ToFloat32

func (a AnyType) ToFloat32(defaultValue float32) float32

func (AnyType) ToFloat64

func (a AnyType) ToFloat64(defaultValue float64) float64

func (AnyType) ToInt

func (a AnyType) ToInt(defaultValue int) int

func (AnyType) ToInt16

func (a AnyType) ToInt16(defaultValue int16) int16

func (AnyType) ToInt32

func (a AnyType) ToInt32(defaultValue int32) int32

func (AnyType) ToInt64

func (a AnyType) ToInt64(defaultValue int64) int64

func (AnyType) ToInt8

func (a AnyType) ToInt8(defaultValue int8) int8

func (AnyType) ToMap

func (a AnyType) ToMap(defaultValue map[string]interface{}) map[string]interface{}

func (AnyType) ToRune

func (a AnyType) ToRune(defaultValue rune) rune

func (AnyType) ToString

func (a AnyType) ToString(defaultValue string) string

func (AnyType) ToTime

func (a AnyType) ToTime(defaultValue time.Time) time.Time

func (AnyType) ToUint

func (a AnyType) ToUint(defaultValue uint) uint

func (AnyType) ToUint16

func (a AnyType) ToUint16(defaultValue uint16) uint16

func (AnyType) ToUint32

func (a AnyType) ToUint32(defaultValue uint32) uint32

func (AnyType) ToUint64

func (a AnyType) ToUint64(defaultValue uint64) uint64

func (AnyType) ToUint8

func (a AnyType) ToUint8(defaultValue uint8) uint8

func (AnyType) ToUintptr

func (a AnyType) ToUintptr(defaultValue uintptr) uintptr

func (AnyType) Value

func (a AnyType) Value() interface{}

获取interface值

type H

type H = map[string]interface{}

Jump to

Keyboard shortcuts

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