Documentation
¶
Overview ¶
type_assertion.go
Index ¶
- func ConvertInterfaceSliceToStringMap(input interface{}) map[string][]string
- func ConvertToMapFromInterface(value interface{}) map[string]interface{}
- func GetBoolFromInterface(val interface{}) bool
- func GetBoolFromMap(m map[string]interface{}, key string) bool
- func GetInt(val interface{}) int
- func GetIntFromInterface(val interface{}) int
- func GetIntFromMap(m map[string]interface{}, key string) int
- func GetString(val interface{}) string
- func GetStringBoolMapFromInterface(val interface{}) map[string]bool
- func GetStringFromInterface(val interface{}) string
- func GetStringFromMap(m map[string]interface{}, key string) string
- func GetStringFromSlice(slice []interface{}, str string) bool
- func GetStringSliceFromInterface(input interface{}) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertInterfaceSliceToStringMap ¶
ConvertInterfaceSliceToStringMap safely converts an interface slice to a map of string slices.
func ConvertToMapFromInterface ¶
func ConvertToMapFromInterface(value interface{}) map[string]interface{}
ConvertToMapFromInterface safely converts an interface{} to a map[string]interface{}, handling nil values.
func GetBoolFromInterface ¶
func GetBoolFromInterface(val interface{}) bool
GetBoolFromInterface safely retrieves a bool value from an interface{}, handling nil values.
func GetBoolFromMap ¶
GetBoolFromMap safely retrieves a bool value from a map, returning a default value for nil or not found.
func GetInt ¶
func GetInt(val interface{}) int
GetInt safely performs an int type assertion, handling nil values.
func GetIntFromInterface ¶
func GetIntFromInterface(val interface{}) int
GetIntFromInterface safely retrieves an int value from an interface{}, handling nil values.
func GetIntFromMap ¶
GetIntFromMap safely retrieves an int value from a map, returning a default value for nil or not found.
func GetString ¶
func GetString(val interface{}) string
GetString safely performs a string type assertion, handling nil values.
func GetStringBoolMapFromInterface ¶
GetStringBoolMapFromInterface safely retrieves a map[string]bool value from an interface{}, handling nil values and various keys.
func GetStringFromInterface ¶
func GetStringFromInterface(val interface{}) string
GetStringFromInterface safely retrieves a string value from an interface{}, handling nil values.
func GetStringFromMap ¶
GetStringFromMap safely retrieves a string value from a map, returning a default value for nil or not found.
func GetStringFromSlice ¶
GetStringFromSlice checks if a string is present in a slice of strings.
func GetStringSliceFromInterface ¶
func GetStringSliceFromInterface(input interface{}) []string
GetStringSliceFromInterface safely converts an interface slice to a string slice.
Types ¶
This section is empty.