MCPcopy
hub / github.com/gofiber/fiber / parse

Function parse

binder/mapping.go:93–108  ·  view source on GitHub ↗

parse data into the map or struct

(aliasTag string, out any, data map[string][]string, files ...map[string][]*multipart.FileHeader)

Source from the content-addressed store, hash-verified

91
92// parse data into the map or struct
93func parse(aliasTag string, out any, data map[string][]string, files ...map[string][]*multipart.FileHeader) error {
94 ptrVal := reflect.ValueOf(out)
95
96 // Get pointer value
97 if ptrVal.Kind() == reflect.Pointer {
98 ptrVal = ptrVal.Elem()
99 }
100
101 // Parse into the map
102 if ptrVal.Kind() == reflect.Map && ptrVal.Type().Key().Kind() == reflect.String {
103 return parseToMap(ptrVal, data)
104 }
105
106 // Parse into the struct
107 return parseToStruct(aliasTag, out, data, files...)
108}
109
110// Parse data into the struct with gofiber/schema
111func parseToStruct(aliasTag string, out any, data map[string][]string, files ...map[string][]*multipart.FileHeader) error {

Callers 10

BindMethod · 0.85
BindMethod · 0.85
Test_parse_function_mapsFunction · 0.85
BindMethod · 0.85
bindMultipartMethod · 0.85
BindMethod · 0.85
BindMethod · 0.85
BindMethod · 0.85

Calls 3

parseToMapFunction · 0.85
parseToStructFunction · 0.85
TypeMethod · 0.65