Documentation ¶
Index ¶
- func IntPtrTo64(ptr interface{}) (value int64)
- func MapToStruct(data map[string]interface{}, obj interface{}) error
- func String(bytes *[]byte) *string
- func StructToMap(a any) map[string]any
- func StructToMapStr(a any) map[string]string
- func ToAny[T any](a any) T
- func ToAnyλ[T any](a any) (T, error)
- func ToBool(a any) bool
- func ToBoolλ(a any) (bool, error)
- func ToDuration(i any) time.Duration
- func ToDurationλ(i any) (time.Duration, error)
- func ToFloat32(i any) float32
- func ToFloat32λ(i any) (float32, error)
- func ToFloat64(i any) float64
- func ToFloat64λ(i any) (float64, error)
- func ToInt(i any) int
- func ToInt16(i any) int16
- func ToInt16λ(i any) (int16, error)
- func ToInt32(i any) int32
- func ToInt32λ(i any) (int32, error)
- func ToInt64(i any) int64
- func ToInt64λ(i any) (int64, error)
- func ToInt8(i any) int8
- func ToInt8λ(i any) (int8, error)
- func ToIntλ(i any) (int, error)
- func ToMapStr(a any) map[string]string
- func ToMapStrλ(a any) (map[string]string, error)
- func ToString(i any) string
- func ToStringλ(i any) (string, error)
- func ToUint(i any) uint
- func ToUint16(i any) uint16
- func ToUint16λ(i any) (uint16, error)
- func ToUint32(i any) uint32
- func ToUint32λ(i any) (uint32, error)
- func ToUint64(i any) uint64
- func ToUint64λ(i any) (uint64, error)
- func ToUint8(i any) uint8
- func ToUint8λ(i any) (uint8, error)
- func ToUintλ(i any) (uint, error)
- func UintPtrTo64(ptr interface{}) (value uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntPtrTo64 ¶
func IntPtrTo64(ptr interface{}) (value int64)
func MapToStruct ¶
MapToStruct map转Struct
func StructToMap ¶
StructToMap converts struct to map[string]any. Such as struct{I int, S string}{I: 1, S: "a"} to map["I":1 "S":"a"]. Note that unexported fields of struct can't be converted.
func StructToMapStr ¶ added in v0.3.5
StructToMapStr converts struct to map[string]string. Such as struct{I int, S string}{I: 1, S: "a"} to map["I":"1" "S":"a"]. Note that unexported fields of struct can't be converted.
func ToDuration ¶ added in v0.3.5
ToDuration casts any type to a time.Duration type.
func ToDurationλ ¶ added in v0.3.5
ToDurationλ casts any type to time.Duration type.
func ToFloat32λ ¶ added in v0.3.5
ToFloat32λ casts any type to a float32 type.
func ToFloat64λ ¶ added in v0.3.5
ToFloat64λ casts any type to a float64 type.
func UintPtrTo64 ¶
func UintPtrTo64(ptr interface{}) (value uint64)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.