MCPcopy Index your code
hub / github.com/labstack/echo / FormValues

Function FormValues

binder_generic.go:273–287  ·  view source on GitHub ↗

FormValues extracts and parses all values for a form values key as a slice. It returns the typed slice and an error if binding any value fails. Returns ErrNonExistentKey if parameter not found. See ParseValues for supported types and options

(c *Context, key string, opts ...any)

Source from the content-addressed store, hash-verified

271//
272// See ParseValues for supported types and options
273func FormValues[T any](c *Context, key string, opts ...any) ([]T, error) {
274 formValues, err := c.FormValues()
275 if err != nil {
276 return nil, fmt.Errorf("failed to parse form values, key: %s, err: %w", key, err)
277 }
278 values, ok := formValues[key]
279 if !ok {
280 return nil, ErrNonExistentKey
281 }
282 result, err := ParseValues[T](values, opts...)
283 if err != nil {
284 return nil, NewBindingError(key, values, "form values", err)
285 }
286 return result, nil
287}
288
289// FormValuesOr extracts and parses all values for a form values key as a slice.
290// Returns defaultValue if the parameter is not found.

Callers 1

Calls 2

NewBindingErrorFunction · 0.85
FormValuesMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…