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

Function QueryParams

binder_generic.go:164–175  ·  view source on GitHub ↗

QueryParams extracts and parses all values for a query parameter 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

162//
163// See ParseValues for supported types and options
164func QueryParams[T any](c *Context, key string, opts ...any) ([]T, error) {
165 values, ok := c.QueryParams()[key]
166 if !ok {
167 return nil, ErrNonExistentKey
168 }
169
170 result, err := ParseValues[T](values, opts...)
171 if err != nil {
172 return nil, NewBindingError(key, values, "query params", err)
173 }
174 return result, nil
175}
176
177// QueryParamsOr extracts and parses all values for a query parameter key as a slice.
178// Returns defaultValue if the parameter is not found.

Callers 1

Calls 2

NewBindingErrorFunction · 0.85
QueryParamsMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…