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

Function valuesFromQuery

middleware/extractor.go:164–177  ·  view source on GitHub ↗

valuesFromQuery returns a function that extracts values from the query string.

(param string, limit uint)

Source from the content-addressed store, hash-verified

162
163// valuesFromQuery returns a function that extracts values from the query string.
164func valuesFromQuery(param string, limit uint) ValuesExtractor {
165 if limit == 0 {
166 limit = 1
167 }
168 return func(c *echo.Context) ([]string, ExtractorSource, error) {
169 result := c.QueryParams()[param]
170 if len(result) == 0 {
171 return nil, ExtractorSourceQuery, errQueryExtractorValueMissing
172 } else if len(result) > int(limit)-1 {
173 result = result[:limit]
174 }
175 return result, ExtractorSourceQuery, nil
176 }
177}
178
179// valuesFromParam returns a function that extracts values from the url param string.
180func valuesFromParam(param string, limit uint) ValuesExtractor {

Callers 2

createExtractorsFunction · 0.85
TestValuesFromQueryFunction · 0.85

Calls 1

QueryParamsMethod · 0.80

Tested by 1

TestValuesFromQueryFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…