cast

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenInterfaceSlices added in v0.12.0

func FlattenInterfaceSlices(in ...interface{}) []interface{}

func InterfaceToBoolSlice

func InterfaceToBoolSlice(in interface{}) ([]bool, bool)

func InterfaceToFloat32

func InterfaceToFloat32(in interface{}) (float32, bool)

InterfaceToFloat32 will convert any int or float type

func InterfaceToFloat32Slice

func InterfaceToFloat32Slice(in interface{}) ([]float32, bool)

func InterfaceToFloat64

func InterfaceToFloat64(in interface{}) (float64, bool)

InterfaceToFloat64 will convert any int or float type

func InterfaceToFloat64Slice

func InterfaceToFloat64Slice(in interface{}) ([]float64, bool)

func InterfaceToInt

func InterfaceToInt(in interface{}) (int, bool)

func InterfaceToInt16

func InterfaceToInt16(in interface{}) (int16, bool)

func InterfaceToInt16Downcast

func InterfaceToInt16Downcast(in interface{}) (int16, bool)

func InterfaceToInt32

func InterfaceToInt32(in interface{}) (int32, bool)

func InterfaceToInt32Downcast

func InterfaceToInt32Downcast(in interface{}) (int32, bool)

func InterfaceToInt32Slice

func InterfaceToInt32Slice(in interface{}) ([]int32, bool)

func InterfaceToInt64

func InterfaceToInt64(in interface{}) (int64, bool)

func InterfaceToInt64Downcast

func InterfaceToInt64Downcast(in interface{}) (int64, bool)

func InterfaceToInt64Slice

func InterfaceToInt64Slice(in interface{}) ([]int64, bool)

func InterfaceToInt8

func InterfaceToInt8(in interface{}) (int8, bool)

func InterfaceToInt8Downcast

func InterfaceToInt8Downcast(in interface{}) (int8, bool)

func InterfaceToIntDowncast

func InterfaceToIntDowncast(in interface{}) (int, bool)

func InterfaceToIntSlice

func InterfaceToIntSlice(in interface{}) ([]int, bool)

func InterfaceToInterfaceInterfaceMap

func InterfaceToInterfaceInterfaceMap(in interface{}) (map[interface{}]interface{}, bool)

func InterfaceToInterfaceSlice

func InterfaceToInterfaceSlice(in interface{}) ([]interface{}, bool)

func InterfaceToStrInterfaceMap

func InterfaceToStrInterfaceMap(in interface{}) (map[string]interface{}, bool)

func InterfaceToStrInterfaceMapSlice

func InterfaceToStrInterfaceMapSlice(in interface{}) ([]map[string]interface{}, bool)

func InterfaceToStrSlice

func InterfaceToStrSlice(in interface{}) ([]string, bool)

func InterfaceToStrStrMap

func InterfaceToStrStrMap(in interface{}) (map[string]string, bool)

func IsFloatType

func IsFloatType(in interface{}) bool

func IsIntType

func IsIntType(in interface{}) bool

func IsNumericType added in v0.8.0

func IsNumericType(in interface{}) bool

func IsScalarType

func IsScalarType(in interface{}) bool

func JSONMarshallable added in v0.24.0

func JSONMarshallable(in interface{}) (interface{}, bool)

Recursively casts interface->interface maps to string->interface maps

func JSONNumber added in v0.8.0

func JSONNumber(in interface{}) interface{}

func JSONNumberToInt

func JSONNumberToInt(in interface{}) (interface{}, bool)

func JSONNumberToIntOrFloat

func JSONNumberToIntOrFloat(in interface{}) (interface{}, bool)

func JSONNumbers added in v0.8.0

func JSONNumbers(in []interface{}) []interface{}

func StrMapToStrInterfaceMap added in v0.15.0

func StrMapToStrInterfaceMap(in map[string]string) map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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