func getPropValueMap()

in types/utils.go [142:166]


func getPropValueMap(input interface{}, prefix string) map[string]interface{} {
	res := make(map[string]interface{})
	if input == nil {
		return res
	}
	switch cur := input.(type) {
	case map[string]interface{}:
		for key, value := range cur {
			propValueMap := getPropValueMap(value, prefix+"."+key)
			for k, v := range propValueMap {
				res[k] = v
			}
		}
	case []interface{}:
		for index, value := range cur {
			propValueMap := getPropValueMap(value, fmt.Sprintf("%s.%d", prefix, index))
			for k, v := range propValueMap {
				res[k] = v
			}
		}
	default:
		res[prefix] = cur
	}
	return res
}